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

Commit

Permalink
fix(copy): support overriding config entries with empty objects
Browse files Browse the repository at this point in the history
  • Loading branch information
danbucholtz committed Feb 15, 2017
1 parent a735e96 commit 5879a8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function processRemoveFile(changedFile: ChangedFile) {
// delete any destination files that match the source file
const list = copyFilePathCache.get(changedFile.filePath) || [];
copyFilePathCache.delete(changedFile.filePath);
const promises: Promise<void>[] = [];
const promises: Promise<void[]>[] = [];
const deletedFilePaths: string[] = [];
list.forEach(copiedFile => {
const promise = unlinkAsync(copiedFile.absoluteDestPath);
Expand Down Expand Up @@ -251,8 +251,10 @@ export function copyConfigToWatchConfig(context: BuildContext): Watcher {
const copyConfig: CopyConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile);
let results: GlobObject[] = [];
for (const key of Object.keys(copyConfig)) {
const list = generateGlobTasks(copyConfig[key].src, {});
results = results.concat(list);
if (copyConfig[key] && copyConfig[key].src) {
const list = generateGlobTasks(copyConfig[key].src, {});
results = results.concat(list);
}
}

const paths: string[] = [];
Expand Down

0 comments on commit 5879a8b

Please sign in to comment.