|
|
@ -744,10 +744,10 @@ class FileManager extends Plugin { |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
if (override === undefined) override = false |
|
|
|
if (override === undefined) override = false |
|
|
|
|
|
|
|
|
|
|
|
async.each(Object.keys(filesSet), (file, callback) => { |
|
|
|
async.each(Object.keys(filesSet), async (file, callback) => { |
|
|
|
if (override) { |
|
|
|
if (override) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
self._deps.filesProviders[fileProvider].set(file, filesSet[file].content) |
|
|
|
await self._deps.filesProviders[fileProvider].set(file, filesSet[file].content) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
return callback(e.message || e) |
|
|
|
return callback(e.message || e) |
|
|
|
} |
|
|
|
} |
|
|
@ -756,14 +756,15 @@ class FileManager extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
helper.createNonClashingName(file, self._deps.filesProviders[fileProvider], |
|
|
|
helper.createNonClashingName(file, self._deps.filesProviders[fileProvider], |
|
|
|
(error, name) => { |
|
|
|
async (error, name) => { |
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
|
modalDialogCustom.alert('Unexpected error loading the file ' + error) |
|
|
|
modalDialogCustom.alert('Unexpected error loading the file ' + error) |
|
|
|
} else if (helper.checkSpecialChars(name)) { |
|
|
|
} else if (helper.checkSpecialChars(name)) { |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
try { |
|
|
|
try { |
|
|
|
self._deps.filesProviders[fileProvider].set(name, filesSet[file].content) |
|
|
|
console.log('set ', fileProvider, name, filesSet[file].content) |
|
|
|
|
|
|
|
await self._deps.filesProviders[fileProvider].set(name, filesSet[file].content) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
return callback(e.message || e) |
|
|
|
return callback(e.message || e) |
|
|
|
} |
|
|
|
} |
|
|
|