|
|
@ -342,11 +342,18 @@ class FileManager extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setBatchFiles (filesSet, fileProvider, callback) { |
|
|
|
setBatchFiles (filesSet, fileProvider, override, callback) { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
|
|
|
|
if (override === undefined) override = false |
|
|
|
|
|
|
|
|
|
|
|
async.each(Object.keys(filesSet), (file, callback) => { |
|
|
|
async.each(Object.keys(filesSet), (file, callback) => { |
|
|
|
|
|
|
|
if (override) { |
|
|
|
|
|
|
|
self._deps.filesProviders[fileProvider].set(file, filesSet[file].content) |
|
|
|
|
|
|
|
self.syncEditor(fileProvider + file) |
|
|
|
|
|
|
|
return callback() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
helper.createNonClashingName(file, self._deps.filesProviders[fileProvider], |
|
|
|
helper.createNonClashingName(file, self._deps.filesProviders[fileProvider], |
|
|
|
(error, name) => { |
|
|
|
(error, name) => { |
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
@ -355,11 +362,11 @@ class FileManager extends Plugin { |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
self._deps.filesProviders[fileProvider].set(name, filesSet[file].content) |
|
|
|
self._deps.filesProviders[fileProvider].set(name, filesSet[file].content) |
|
|
|
|
|
|
|
self.syncEditor(fileProvider + name) |
|
|
|
} |
|
|
|
} |
|
|
|
callback() |
|
|
|
callback() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, (error) => { |
|
|
|
}, (error) => { |
|
|
|
if (!error) self.switchFile() |
|
|
|
|
|
|
|
if (callback) callback(error) |
|
|
|
if (callback) callback(error) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|