From e888bff3e6353fb1b3853c8e3015636dbb10e67d Mon Sep 17 00:00:00 2001 From: yi_Xu Date: Wed, 1 Jun 2022 23:02:51 +0800 Subject: [PATCH] chore(bin): Change to '$PSScriptRoot' (#5) --- 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 | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/auto-pr.ps1 b/bin/auto-pr.ps1 index 07c3b35..1702bb7 100644 --- a/bin/auto-pr.ps1 +++ b/bin/auto-pr.ps1 @@ -5,5 +5,5 @@ param( 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 +$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 8d2ca12..cfe5e7d 100644 --- a/bin/checkurls.ps1 +++ b/bin/checkurls.ps1 @@ -1,4 +1,4 @@ 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 +$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 fe8942d..6f6b53a 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -1,4 +1,4 @@ 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 +$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 4fe306d..1884583 100644 --- a/bin/formatjson.ps1 +++ b/bin/formatjson.ps1 @@ -1,4 +1,4 @@ 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 +$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 8c03066..bca8abb 100644 --- a/bin/missing-checkver.ps1 +++ b/bin/missing-checkver.ps1 @@ -1,4 +1,4 @@ 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 +$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 6a741d9..9ff03ac 100644 --- a/bin/test.ps1 +++ b/bin/test.ps1 @@ -1,5 +1,5 @@ #Requires -Modules @{ ModuleName = 'Pester'; MaximumVersion = '4.99' } -if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } -$result = Invoke-Pester "$psscriptroot/.." -PassThru +if (!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) } +$result = Invoke-Pester "$PSScriptRoot/.." -PassThru exit $result.FailedCount