commit 18593c5c1fc0b380e68ba8a4656643091926ea6e
parent 5e4bacbe07084396eda978b2b7ca246cc72506b3
Author: Zane Hitchcox <zwhitchcox@gmail.com>
Date: Fri, 22 Apr 2016 16:47:06 -0500
Fixes #614
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/copy.js b/tools/copy.js
@@ -37,10 +37,12 @@ async function copy({ watch } = {}) {
const watcher = await new Promise((resolve, reject) => {
gaze('src/content/**/*.*', (err, val) => err ? reject(err) : resolve(val));
});
- watcher.on('changed', async (file) => {
+ const cp = async (file) => {
const relPath = file.substr(path.join(__dirname, '../src/content/').length);
await ncp(`src/content/${relPath}`, `build/content/${relPath}`);
- });
+ }
+ watcher.on('changed', cp);
+ watcher.on('added', cp);
}
}