aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2015-08-21 21:36:15 +1000
committerSam Potts <me@sampotts.me>2015-08-21 21:36:15 +1000
commit6543fc1e5bb8445f816b8206f6b36521dead6364 (patch)
treeacddad6f7ac4fdf45cdcf8d18d37de8c2c691c65 /gulpfile.js
parent9133247cdf35864981ecfeb421789f2b41b3b0c9 (diff)
downloadplyr-6543fc1e5bb8445f816b8206f6b36521dead6364.tar.lz
plyr-6543fc1e5bb8445f816b8206f6b36521dead6364.tar.xz
plyr-6543fc1e5bb8445f816b8206f6b36521dead6364.zip
Fixed bug with API use on basic supported browsers
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js15
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 () {