From e67399ad69938fecc96588e18567485b67ad4ae9 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Fri, 5 Nov 2021 18:05:05 +0800 Subject: [PATCH] fix(script): use scoop prefix to correctly find scoop's path (#2878) * fix(checkver): use scoop prefix to correctly find scoop's path * Update checkver.ps1 * Update auto-pr.ps1 * Update checkurls.ps1 * Update formatjson.ps1 * Update missing-checkver.ps1 * Update test.ps1 --- bin/auto-pr.ps1 | 2 +- bin/checkurls.ps1 | 2 +- bin/checkver.ps1 | 2 +- bin/formatjson.ps1 | 2 +- bin/missing-checkver.ps1 | 2 +- bin/test.ps1 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/auto-pr.ps1 b/bin/auto-pr.ps1 index 8442b45c28..e01544cdae 100644 --- a/bin/auto-pr.ps1 +++ b/bin/auto-pr.ps1 @@ -3,7 +3,7 @@ param( [String]$upstream = "ScoopInstaller/Main:master" ) -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } $autopr = "$env:SCOOP_HOME/bin/auto-pr.ps1" $dir = "$psscriptroot/../bucket" # checks the parent dir Invoke-Expression -command "& '$autopr' -dir '$dir' -upstream $upstream $($args | ForEach-Object { "$_ " })" diff --git a/bin/checkurls.ps1 b/bin/checkurls.ps1 index 5b76d590ea..8d2ca12126 100644 --- a/bin/checkurls.ps1 +++ b/bin/checkurls.ps1 @@ -1,4 +1,4 @@ -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } $checkurls = "$env:SCOOP_HOME/bin/checkurls.ps1" $dir = "$psscriptroot/../bucket" # checks the parent dir Invoke-Expression -command "& '$checkurls' -dir '$dir' $($args | ForEach-Object { "$_ " })" diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index a3ddf32e64..fe8942d28c 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -1,4 +1,4 @@ -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } $checkver = "$env:SCOOP_HOME/bin/checkver.ps1" $dir = "$psscriptroot/../bucket" # checks the parent dir Invoke-Expression -command "& '$checkver' -dir '$dir' $($args | ForEach-Object { "$_ " })" diff --git a/bin/formatjson.ps1 b/bin/formatjson.ps1 index 84725a954a..4fe306de11 100644 --- a/bin/formatjson.ps1 +++ b/bin/formatjson.ps1 @@ -1,4 +1,4 @@ -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } $formatjson = "$env:SCOOP_HOME/bin/formatjson.ps1" $path = "$psscriptroot/../bucket" # checks the parent dir Invoke-Expression -command "& '$formatjson' -dir '$path' $($args | ForEach-Object { "$_ " })" diff --git a/bin/missing-checkver.ps1 b/bin/missing-checkver.ps1 index ee7b77ec4d..8c030662ba 100644 --- a/bin/missing-checkver.ps1 +++ b/bin/missing-checkver.ps1 @@ -1,4 +1,4 @@ -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } $missing_checkver = "$env:SCOOP_HOME/bin/missing-checkver.ps1" $dir = "$psscriptroot/../bucket" # checks the parent dir Invoke-Expression -command "& '$missing_checkver' -dir '$dir' $($args | ForEach-Object { "$_ " })" diff --git a/bin/test.ps1 b/bin/test.ps1 index 71d4032b3a..fc150a557e 100644 --- a/bin/test.ps1 +++ b/bin/test.ps1 @@ -1,4 +1,4 @@ #requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '4.4.0' } -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = resolve-path (split-path (split-path (scoop which scoop))) } +if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } Invoke-Pester "$psscriptroot/.."