clone: save app config

clone also clones the tags, labels and icon. this is not done for
restore or import since it's not clear if this is a good idea or not.
for example, if user had some custom tags and label set and then restores
to some old backup, is it expected to reset the labels and tags?
This commit is contained in:
Girish Ramakrishnan
2021-05-25 21:31:48 -07:00
parent 2fb6be81fc
commit 431e2a6ab9
4 changed files with 71 additions and 44 deletions

View File

@@ -1063,16 +1063,16 @@ function snapshotApp(app, progressCallback, callback) {
const startTime = new Date();
progressCallback({ message: `Snapshotting app ${app.fqdn}` });
if (!safe.fs.writeFileSync(path.join(paths.APPS_DATA_DIR, app.id + '/config.json'), JSON.stringify(app))) {
return callback(new BoxError(BoxError.FS_ERROR, 'Error creating config.json: ' + safe.error.message));
}
apps.backupConfig(app, function (error) {
if (error) return callback(error);
services.backupAddons(app, app.manifest.addons, function (error) {
if (error) return callback(new BoxError(BoxError.EXTERNAL_ERROR, error.message));
services.backupAddons(app, app.manifest.addons, function (error) {
if (error) return callback(error);
debugApp(app, `snapshotApp: took ${(new Date() - startTime)/1000} seconds`);
debugApp(app, `snapshotApp: took ${(new Date() - startTime)/1000} seconds`);
return callback(null);
return callback(null);
});
});
}