Commit 554609b6 authored by yann300's avatar yann300

fix gist deploy

parent f385ce9f
...@@ -269,6 +269,8 @@ function filepanel (appAPI, filesProvider) { ...@@ -269,6 +269,8 @@ function filepanel (appAPI, filesProvider) {
modalDialogCustom.confirm(null, `Created a gist at ${data.html_url}. Would you like to open it in a new window?`, () => { modalDialogCustom.confirm(null, `Created a gist at ${data.html_url}. Would you like to open it in a new window?`, () => {
window.open(data.html_url, '_blank') window.open(data.html_url, '_blank')
}) })
} else {
modalDialogCustom.alert(data.message + ' ' + data.documentation_url)
} }
} }
} }
...@@ -322,15 +324,23 @@ function filepanel (appAPI, filesProvider) { ...@@ -322,15 +324,23 @@ function filepanel (appAPI, filesProvider) {
} }
// return all the files, except the temporary/readonly ones.. // return all the files, except the temporary/readonly ones..
function packageFiles (files, callback) { function packageFiles (filesProvider, callback) {
var ret = {} var ret = {}
// @TODO remove use of `list()` filesProvider.resolveDirectory('browser', (error, files) => {
var filtered = Object.keys(files.list()).filter(function (path) { if (!files.isReadOnly(path)) { return path } }) if (error) callback(error)
async.eachSeries(filtered, function (path, cb) { else {
ret[path.replace(files.type + '/', '')] = { content: files.get(path) } async.eachSeries(Object.keys(files), (path, cb) => {
cb() filesProvider.get(path, (error, content) => {
}, () => { if (error) cb(error)
callback(null, ret) else {
ret[path] = { content }
cb()
}
})
}, (error) => {
callback(error, ret)
})
}
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment