Skip to content

Commit

Permalink
test the behavior of ignoreInitial
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonenene committed Feb 9, 2019
1 parent 4e90fbc commit 5941286
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ export default class Commons {
await lockfile.Unlock(this.en.FILE_SYNC_LOCK);
}

console.log("configWatcher");
console.log(Commons.configWatcher);

let uploadStopped: boolean = true;
Commons.extensionWatcher = chokidar.watch(this.en.ExtensionFolder, {
depth: 0,
ignoreInitial: true
ignoreInitial: false
});
Commons.configWatcher = chokidar.watch(this.en.PATH + "/User/", {
depth: 2,
ignoreInitial: true
ignoreInitial: false
});

// TODO : Uncomment the following lines when code allows feature to update Issue in github code repo - #14444
Expand Down Expand Up @@ -137,7 +140,18 @@ export default class Commons {
// }
// });

Commons.configWatcher.on("add", async (path: string) => {
console.log("Added: " + path);
});

Commons.configWatcher.on("addDir", async (path: string) => {
console.log("Added Dir: " + path);
});

Commons.configWatcher.on("change", async (path: string) => {
console.log("Changed: " + path);
return;

// check sync is locking
if (await lockfile.Check(this.en.FILE_SYNC_LOCK)) {
uploadStopped = false;
Expand Down

0 comments on commit 5941286

Please sign in to comment.