gist delete a file update

pull/1/head
Rob Stupay 5 years ago
parent d76d4f6842
commit 737402e916
  1. 30
      src/app/files/file-explorer.js
  2. 5
      src/lib/gist-handler.js

@ -491,10 +491,40 @@ fileExplorer.prototype.copyFiles = function () {
// ------------------ gist publish --------------
fileExplorer.prototype.updateGist = function () {
let self = this
var gistId = this.files.id
var fileList = Object.keys(this.files.files)
// fileList is an array of files in the github gist - not the updated one
var updatedFileList
// loop through fileList and check if each element is in updatedFileList
// if one is not there in updated file list add it and make its content null
self.packageFiles(self.files, (error, packaged) => {
if (error) {
console.log(error)
} else {
updatedFileList = Object.keys(packaged)
}
})
if (!gistId) {
tooltip('no gist content is currently loaded.')
} else {
// check that the file list is still the same
// console.log('RS ' , this.files)
// make an array with just the names of the files
// self.packageFiles(self.files, (error, packaged) => {
// if (error) {
// console.log(error)
// } else {
// console.log('file list is: ', packaged)
// }
// })
this.toGist(gistId)
}
}

@ -54,7 +54,10 @@ function GistHandler (_window) {
return
}
fileManager.setBatchFiles(data.files, 'gist', (errorLoadingFile) => {
if (!errorLoadingFile) gistProvider.id = gistId
if (!errorLoadingFile) {
gistProvider.id = gistId
gistProvider.files = data.files
}
})
})
})

Loading…
Cancel
Save