From df6e0aca1bbfba5aa42a04d1dd5f59a6e820b594 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 13 Aug 2016 10:43:32 +0200 Subject: [PATCH] Create folder if it doesn't exist when downloading files --- script/build | 1 - script/lib/download-file-from-github.js | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/script/build b/script/build index 42130103a..28dceb3de 100755 --- a/script/build +++ b/script/build @@ -49,7 +49,6 @@ prebuildLessCache() generateMetadata() generateAPIDocs() downloadChromedriver() - dumpSymbols() .then(packageApplication) .then(packagedAppPath => { diff --git a/script/lib/download-file-from-github.js b/script/lib/download-file-from-github.js index 9a504e9f2..2969ea2dc 100644 --- a/script/lib/download-file-from-github.js +++ b/script/lib/download-file-from-github.js @@ -1,4 +1,7 @@ +'use strict' + const fs = require('fs-extra') +const path = require('path') const syncRequest = require('sync-request') module.exports = function (downloadURL, destinationPath) { @@ -8,6 +11,7 @@ module.exports = function (downloadURL, destinationPath) { }) if (response.statusCode === 200) { + fs.mkdirpSync(path.dirname(destinationPath)) fs.writeFileSync(destinationPath, response.body) } else { throw new Error('Error downloading file. HTTP Status ' + response.statusCode + '.')