diff options
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gulpfile.js b/gulpfile.js index 3edf9209..5b354740 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -66,7 +66,12 @@ package = loadJSON(path.join(root, "package.json")); // Load json function loadJSON(path) { - return JSON.parse(fs.readFileSync(path)); + try { + return JSON.parse(fs.readFileSync(path)); + } + catch(err) { + return {}; + } } var build = { @@ -215,8 +220,12 @@ options = { }, gzippedOnly: true } -}, -cdnpath = new RegExp(aws.cdn.bucket + "\/(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)","gi"); +}; + +// If aws is setup +if("cdn" in aws) { + var cdnpath = new RegExp(aws.cdn.bucket + "\/(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)","gi"); +} // Publish version to CDN bucket gulp.task("cdn", function () { |