Skip to content

Commit f24159c

Browse files
authored
fix(test-running-process): Fix wrong output (#4731)
1 parent 14854c3 commit f24159c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
### Features
55

6-
- **config:** Allow Scoop to ignore running processes during reset/uninstall/update ([#4713](https://github.com/ScoopInstaller/Scoop/issues/4713))
6+
- **config:** Allow Scoop to ignore running processes during reset/uninstall/update ([#4713](https://github.com/ScoopInstaller/Scoop/issues/4713), [#4731](https://github.com/ScoopInstaller/Scoop/issues/4731))
77
- **scoop-download:** Add `scoop download` command ([#4621](https://github.com/ScoopInstaller/Scoop/issues/4621))
88
- **scoop-(install|virustotal):** Allow skipping update check ([#4634](https://github.com/ScoopInstaller/Scoop/issues/4634))
99
- **scoop-bucket:** List more detailed information for buckets ([#4704](https://github.com/ScoopInstaller/Scoop/pull/4704))

lib/install.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,11 +1217,15 @@ function test_running_process($app, $global) {
12171217
$processdir = appdir $app $global | Convert-Path
12181218
$running_processes = Get-Process | Where-Object { $_.Path -like "$processdir\*" }
12191219

1220-
if ($running_processes -and !(get_config 'ignore_running_processes')) {
1221-
error "Application `"$app`" is still running. Close all instances and try again."
1222-
return $true
1220+
if ($running_processes) {
1221+
if (get_config 'ignore_running_processes') {
1222+
warn "Application `"$app`" is still running. Scoop is configured to ignore this condition."
1223+
return $false
1224+
} else {
1225+
error "Application `"$app`" is still running. Close all instances and try again."
1226+
return $true
1227+
}
12231228
} else {
1224-
warn "Application `"$app`" is still running. Scoop is configured to ignore this condition."
12251229
return $false
12261230
}
12271231
}

0 commit comments

Comments
 (0)