Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 5d82829

Browse files
committed
refactor(copy): generate context in index
1 parent 19464b3 commit 5d82829

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/copy.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { mkdirpSync } from 'fs-extra';
22
import { dirname as pathDirname, join as pathJoin, relative as pathRelative, resolve as pathResolve } from 'path';
33
import { Logger } from './logger/logger';
4-
import { fillConfigDefaults, generateContext, getUserConfigFile, replacePathVars } from './util/config';
4+
import { fillConfigDefaults, getUserConfigFile, replacePathVars } from './util/config';
55
import { emit, EventType } from './util/events';
66
import { generateGlobTasks, globAll, GlobObject, GlobResult } from './util/glob-util';
77
import { copyFileAsync, rimRafAsync, unlinkAsync } from './util/helpers';
@@ -12,8 +12,7 @@ const copyFilePathCache = new Map<string, CopyToFrom[]>();
1212

1313
const FILTER_OUT_DIRS_FOR_CLEAN = ['{{WWW}}', '{{BUILD}}'];
1414

15-
export function copy(context?: BuildContext, configFile?: string) {
16-
context = generateContext(context);
15+
export function copy(context: BuildContext, configFile?: string) {
1716
configFile = getUserConfigFile(context, taskInfo, configFile);
1817

1918
const logger = new Logger('copy');
@@ -241,8 +240,7 @@ function cleanConfigContent(dictionaryKeys: string[], copyConfig: CopyConfig, co
241240
});
242241
}
243242

244-
export function copyConfigToWatchConfig(context?: BuildContext): Watcher {
245-
context = generateContext(context);
243+
export function copyConfigToWatchConfig(context: BuildContext): Watcher {
246244
const configFile = getUserConfigFile(context, taskInfo, '');
247245
const copyConfig: CopyConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile);
248246
let results: GlobObject[] = [];

0 commit comments

Comments
 (0)