Skip to content

Commit ba4abc5

Browse files
committed
Fix uninstalling bin directory on *nix systems
1 parent 1922a07 commit ba4abc5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

backend/src/BinaryInstaller.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import tmp from 'tmp'
2+
import path from 'path'
23
import debug from 'debug'
3-
import Logger from './Logger'
4-
import AirBrake from './AirBrake'
54
import Environment from './Environment'
65
import EventBus from './EventBus'
76
import Installer from './Installer'
@@ -77,7 +76,12 @@ class BinaryInstaller {
7776
} else {
7877
if (existsSync(Environment.userPath)) commands.push(`rm -rf ${Environment.userPath}`)
7978
if (existsSync(Environment.adminPath)) commands.push(`rm -rf ${Environment.adminPath}`)
80-
if (existsSync(Environment.binPath)) commands.push(`rm -rf ${Environment.binPath}`)
79+
installers.map(installer => {
80+
const files = installer.dependencyNames.concat(installer.binaryName)
81+
files.map(
82+
file => installer.fileExists(file) && commands.push(`rm -f ${path.join(Environment.binPath, file)}`)
83+
)
84+
})
8185
}
8286

8387
await commands.exec()

backend/src/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const UNIX_BINARIES = '/usr/local/bin/'
2525
export const UNIX_USER_SETTINGS = path.join(os.homedir(), '.remoteit')
2626
export const UNIX_ADMIN_SETTINGS = '/etc/remoteit'
2727

28-
// export const WIN_BINARIES = path.join(os.homedir(), 'AppData/Local/remoteit/bin')
2928
export const WIN_BINARIES = path.normalize('/Program Files/remoteit/')
3029
export const WIN_USER_SETTINGS = path.join(os.homedir(), 'AppData/Local/remoteit')
3130
export const WIN_ADMIN_SETTINGS = path.normalize('/ProgramData/remoteit')

0 commit comments

Comments
 (0)