From e751b5e3be57ad631dd85b6fe8e154ddf34938d5 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 11 Apr 2016 03:04:14 -0700 Subject: [PATCH] Create empty install.json if none exists. --- Makefile | 5 ++++- tools/install.js | 14 ++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index e410884a2..9fcdaedcc 100644 --- a/Makefile +++ b/Makefile @@ -163,13 +163,16 @@ builds/% : testbuilds/% $(jshint) $(cp_deps) test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json node tools/markdown.js -.jshintrc: tools/templates.coffee src/meta/jshint.json $(template_deps) +.jshintrc : tools/templates.coffee src/meta/jshint.json $(template_deps) $(template) src/meta/jshint.json .jshintrc .events/jshint.% : tmp/%.js $(jshint_deps) | .events $(BIN)jshint $< echo -> $@ +install.json : + echo {}> $@ + .events/install : $(testbuilds) $(jshint) install.json tools/install.js node_modules/fs-extra/package.json | .events node tools/install.js echo -> $@ diff --git a/tools/install.js b/tools/install.js index 17b0cceda..86c20cbfe 100644 --- a/tools/install.js +++ b/tools/install.js @@ -1,14 +1,8 @@ var fs = require('fs-extra'); -try { - var installMap = fs.readJsonSync('install.json'); - for (src in installMap) { - for (dest of installMap[src]) { - fs.copySync(src, dest); - } - } -} catch(err) { - if (err.code !== 'ENOENT') { - throw err; +var installMap = fs.readJsonSync('install.json'); +for (src in installMap) { + for (dest of installMap[src]) { + fs.copySync(src, dest); } }