If app.dataDir is set, first unmount from sftp before deleting on uninstall
This commit is contained in:
@@ -743,7 +743,7 @@ function migrateDataDir(app, args, progressCallback, callback) {
|
||||
}
|
||||
|
||||
// We do this after the app has the new data commited to the database
|
||||
sftp.rebuild(function (error) {
|
||||
sftp.rebuild({}, function (error) {
|
||||
if (error) console.error('Failed to rebuild sftp addon:', error);
|
||||
callback();
|
||||
});
|
||||
@@ -984,16 +984,22 @@ function uninstall(app, args, progressCallback, callback) {
|
||||
progressCallback.bind(null, { percent: 30, message: 'Teardown addons' }),
|
||||
addons.teardownAddons.bind(null, app, app.manifest.addons),
|
||||
|
||||
progressCallback.bind(null, { percent: 40, message: 'Deleting app data directory' }),
|
||||
progressCallback.bind(null, { percent: 40, message: 'Remove sftp addon binding' }),
|
||||
function (callback) {
|
||||
if (!app.dataDir) return callback();
|
||||
sftp.rebuild({ ignoredDataDirs: [ app.dataDir ] }, callback);
|
||||
},
|
||||
|
||||
progressCallback.bind(null, { percent: 50, message: 'Deleting app data directory' }),
|
||||
deleteAppDir.bind(null, app, { removeDirectory: true }),
|
||||
|
||||
progressCallback.bind(null, { percent: 50, message: 'Deleting image' }),
|
||||
progressCallback.bind(null, { percent: 60, message: 'Deleting image' }),
|
||||
docker.deleteImage.bind(null, app.manifest),
|
||||
|
||||
progressCallback.bind(null, { percent: 60, message: 'Unregistering domains' }),
|
||||
progressCallback.bind(null, { percent: 70, message: 'Unregistering domains' }),
|
||||
unregisterSubdomains.bind(null, app, [ { subdomain: app.location, domain: app.domain } ].concat(app.alternateDomains)),
|
||||
|
||||
progressCallback.bind(null, { percent: 70, message: 'Cleanup icon' }),
|
||||
progressCallback.bind(null, { percent: 80, message: 'Cleanup icon' }),
|
||||
removeIcon.bind(null, app),
|
||||
|
||||
progressCallback.bind(null, { percent: 90, message: 'Cleanup logs' }),
|
||||
|
||||
Reference in New Issue
Block a user