fix gist deploy

pull/1/head
yann300 7 years ago
parent f385ce9f87
commit 554609b625
  1. 24
      src/app/panels/file-panel.js

@ -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) {
} }
// 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) => {
filesProvider.get(path, (error, content) => {
if (error) cb(error)
else {
ret[path] = { content }
cb() cb()
}, () => { }
callback(null, ret) })
}, (error) => {
callback(error, ret)
})
}
}) })
} }

Loading…
Cancel
Save