From 7d5a47cc774961c15fdae6be1daf6331282b0161 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Tue, 8 Mar 2022 21:00:58 +0800 Subject: [PATCH] fix(install): Use 'Get-Command' to test scoop install status (#4785) --- CHANGELOG.md | 2 +- bin/install.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acd82856a5..62c4f9b4d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ - **depends:** Prevent error on no URL ([#4595](https://github.com/ScoopInstaller/Scoop/issues/4595)) - **depends:** Check if extractor is available ([#4042](https://github.com/ScoopInstaller/Scoop/issues/4042)) - **decompress:** Fix nested Zstd archive extraction ([#4608](https://github.com/ScoopInstaller/Scoop/issues/4608), [#4639](https://github.com/ScoopInstaller/Scoop/issues/4639)) -- **installed:** Fix 'core/installed' that mark failed app as 'installed' ([#4650](https://github.com/ScoopInstaller/Scoop/issues/4650), [#4676](https://github.com/ScoopInstaller/Scoop/issues/4676), [#4689](https://github.com/ScoopInstaller/Scoop/issues/4689)) +- **installed:** Fix 'core/installed' that mark failed app as 'installed' ([#4650](https://github.com/ScoopInstaller/Scoop/issues/4650), [#4676](https://github.com/ScoopInstaller/Scoop/issues/4676), [#4689](https://github.com/ScoopInstaller/Scoop/issues/4689), [#4785](https://github.com/ScoopInstaller/Scoop/issues/4785)) - **no-junctions:** Fix error when `NO_JUNCTIONS` is been set ([#4722](https://github.com/ScoopInstaller/Scoop/issues/4722), [#4726](https://github.com/ScoopInstaller/Scoop/issues/4726)) - **shim:** Fix PS1 shim error when in different drive in PS7 ([#4614](https://github.com/ScoopInstaller/Scoop/issues/4614)) - **shim:** Fix `sh` shim error in WSL ([#4637](https://github.com/ScoopInstaller/Scoop/issues/4637)) diff --git a/bin/install.ps1 b/bin/install.ps1 index d31c3d1815..68dcf6671c 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -33,7 +33,7 @@ Write-Output 'Initializing...' Invoke-Expression (new-object net.webclient).downloadstring($core_url) # prep -if (installed 'scoop') { +if (Get-Command -Name 'scoop' -ErrorAction SilentlyContinue) { write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red # don't abort if invoked with iex that would close the PS session if ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }