We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a050190 commit 6eec831Copy full SHA for 6eec831
1 file changed
docs/install.ps1
@@ -8,13 +8,18 @@ $INSTALL_DIR = "C:\$($APP_NAME.CASED)"
8
$EXE_PATH = Join-Path -Path $INSTALL_DIR -ChildPath "$($APP_NAME.CLI).exe"
9
10
Function Remove-IfNeeded {
11
- if ($args.Count -gt 0) {
+ if ($args.Count -gt 0) {
12
$procId = $args[0] -as [int]
13
- if ($procId) {
14
- Write-Output "Updating existing install (PID $procId)"
15
- Stop-Process -Id $procId -Force
16
- Remove-Item $EXE_PATH -Force
17
- }
+ }
+ else {
+ $proc = Get-Process -Name $APP_NAME.CLI -ErrorAction SilentlyContinue | Select-Object -First 1
+ if ($proc) { $procId = $proc.Id }
18
+
19
+ if ($procId) {
20
+ Write-Output "FuckingNode found to be running. Removing existing install (PID $procId) for updating."
21
+ Stop-Process -Id $procId -Force
22
+ Remove-Item $EXE_PATH -Force
23
}
24
25
0 commit comments