From 62751367842c6ec0ef6de08239cc72832d61103d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 24 Apr 2014 11:28:39 +0200 Subject: [PATCH] html5: Fix gulp build to create build/ directory Fresh checkout does not contain build/ directory, therefore fs.createWriteStream fails. This commits adds a synchronous check + mkdir to create the directory on the first run. --- html5/configure.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html5/configure.js b/html5/configure.js index 5593f9b..09ed633 100644 --- a/html5/configure.js +++ b/html5/configure.js @@ -55,6 +55,11 @@ exports.local = function configure(env, global, local) { exports.build = function(env, global, local, cb) { var b = browserify({basedir: __dirname}); b.add('./' + pkg.main); + + var bundleDir = path.dirname(global.html5Bundle); + if (!fs.existsSync(bundleDir)) + fs.mkdirSync(bundleDir); + var out = fs.createWriteStream(global.html5Bundle); if(!isDev(env)) {