Skip to content

Commit

Permalink
fix(test-running-process): Fix wrong output (ScoopInstaller#4731)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Feb 11, 2022
1 parent 14854c3 commit f24159c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Features

- **config:** Allow Scoop to ignore running processes during reset/uninstall/update ([#4713](https://github.com/ScoopInstaller/Scoop/issues/4713))
- **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))
- **scoop-download:** Add `scoop download` command ([#4621](https://github.com/ScoopInstaller/Scoop/issues/4621))
- **scoop-(install|virustotal):** Allow skipping update check ([#4634](https://github.com/ScoopInstaller/Scoop/issues/4634))
- **scoop-bucket:** List more detailed information for buckets ([#4704](https://github.com/ScoopInstaller/Scoop/pull/4704))
Expand Down
12 changes: 8 additions & 4 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1217,11 +1217,15 @@ function test_running_process($app, $global) {
$processdir = appdir $app $global | Convert-Path
$running_processes = Get-Process | Where-Object { $_.Path -like "$processdir\*" }

if ($running_processes -and !(get_config 'ignore_running_processes')) {
error "Application `"$app`" is still running. Close all instances and try again."
return $true
if ($running_processes) {
if (get_config 'ignore_running_processes') {
warn "Application `"$app`" is still running. Scoop is configured to ignore this condition."
return $false
} else {
error "Application `"$app`" is still running. Close all instances and try again."
return $true
}
} else {
warn "Application `"$app`" is still running. Scoop is configured to ignore this condition."
return $false
}
}

0 comments on commit f24159c

Please sign in to comment.