fix(desktop): an install another package manager owns gets package-manager removal steps (review)
nativeRemovalInstructions told an 'external' Linux install with no AppImage path to delete an AppImage or app directory, which leaves the package registered with missing files.
This commit is contained in:
committed by
Siddharth Balyan
parent
73133c88c0
commit
6aef8dfe87
@@ -69,6 +69,13 @@ test('only standard installs allow desktop uninstall; managed kinds have no safe
|
||||
test('nativeRemovalInstructions names the steward per kind and OS', () => {
|
||||
assert.match(nativeRemovalInstructions('nix', 'linux'), /installed by Nix/)
|
||||
assert.match(nativeRemovalInstructions('nix', 'darwin'), /flake or profile/)
|
||||
|
||||
for (const platform of ['linux', 'darwin', 'win32']) {
|
||||
const steps = nativeRemovalInstructions('external', platform, '/usr/lib/hermes/hermes')
|
||||
assert.match(steps, /with that package manager/)
|
||||
assert.doesNotMatch(steps, /Delete|Trash/)
|
||||
}
|
||||
|
||||
assert.match(nativeRemovalInstructions('bundled', 'win32'), /Installed apps/)
|
||||
assert.equal(
|
||||
nativeRemovalInstructions('bundled', 'darwin', '/Applications/Hermes Agent Canary.app'),
|
||||
|
||||
@@ -201,6 +201,14 @@ function nativeRemovalInstructions(kind, platform, appPath = null) {
|
||||
)
|
||||
}
|
||||
|
||||
if (kind === 'external') {
|
||||
// Deleting a package manager's files by hand leaves the package registered with missing files.
|
||||
return (
|
||||
'Another package manager installed this Hermes desktop app. ' +
|
||||
'Uninstall it with that package manager, the same way you installed it.'
|
||||
)
|
||||
}
|
||||
|
||||
if (platform === 'win32') {
|
||||
return 'To uninstall, go to Windows Settings → Apps → Installed apps.'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user