Skip to content

Commit

Permalink
style: Use correct casing for $PSScriptRoot (ScoopInstaller#4775)
Browse files Browse the repository at this point in the history
  • Loading branch information
HUMORCE authored Mar 4, 2022
1 parent 59328fc commit 63b858c
Show file tree
Hide file tree
Showing 34 changed files with 137 additions and 138 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
### Styles

- **test:** Format scripts by VSCode's PowerShell extension ([#4609](https://github.com/ScoopInstaller/Scoop/issues/4609))
- **style:** Use correct casing for `$PSScriptRoot` ([#4775](https://github.com/ScoopInstaller/Scoop/issues/4775))

### Tests

Expand Down
16 changes: 8 additions & 8 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ param(
[String] $Version = ''
)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\autoupdate.ps1"
. "$psscriptroot\..\lib\json.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\install.ps1" # needed for hash generation
. "$psscriptroot\..\lib\unix.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\autoupdate.ps1"
. "$PSScriptRoot\..\lib\json.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\install.ps1" # needed for hash generation
. "$PSScriptRoot\..\lib\unix.ps1"

$Dir = Resolve-Path $Dir
$Search = $App
Expand Down
2 changes: 1 addition & 1 deletion bin/refresh.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# for development, update the installed scripts to match local source
. "$psscriptroot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\core.ps1"

$src = relpath ".."
$dest = ensure (versiondir 'scoop' 'current')
Expand Down
6 changes: 2 additions & 4 deletions lib/autoupdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
TODO
- clean up
#>
. "$psscriptroot\..\lib\json.ps1"

. "$psscriptroot/core.ps1"
. "$psscriptroot/json.ps1"
. "$PSScriptRoot\core.ps1"
. "$PSScriptRoot\json.ps1"

function find_hash_in_rdf([String] $url, [String] $basename) {
$data = $null
Expand Down
4 changes: 2 additions & 2 deletions lib/install.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. "$PSScriptRoot/autoupdate.ps1"
. "$PSScriptRoot/buckets.ps1"
. "$PSScriptRoot\autoupdate.ps1"
. "$PSScriptRoot\buckets.ps1"

function nightly_version($date, $quiet = $false) {
$date_str = $date.tostring("yyyyMMdd")
Expand Down
2 changes: 1 addition & 1 deletion lib/json.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function ConvertToPrettyJson {
}

function json_path([String] $json, [String] $jsonpath, [Hashtable] $substitutions, [Boolean] $reverse, [Boolean] $single) {
Add-Type -Path "$psscriptroot\..\supporting\validator\bin\Newtonsoft.Json.dll"
Add-Type -Path "$PSScriptRoot\..\supporting\validator\bin\Newtonsoft.Json.dll"
if ($null -ne $substitutions) {
$jsonpath = substitute $jsonpath $substitutions ($jsonpath -like "*=~*")
}
Expand Down
4 changes: 2 additions & 2 deletions lib/manifest.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. "$psscriptroot/core.ps1"
. "$psscriptroot/autoupdate.ps1"
. "$PSScriptRoot\core.ps1"
. "$PSScriptRoot\autoupdate.ps1"

function manifest_path($app, $bucket) {
fullpath "$(Find-BucketDirectory $bucket)\$(sanitary_path $app).json"
Expand Down
6 changes: 3 additions & 3 deletions libexec/scoop-alias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ param(
[Switch]$verbose = $false
)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\install.ps1"

$script:config_alias = 'alias'

Expand Down
4 changes: 2 additions & 2 deletions libexec/scoop-checkup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Help: Performs a series of diagnostic tests to try to identify things that may
# cause problems with Scoop.

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\diagnostic.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\diagnostic.ps1"

$issues = 0
$defenderIssues = 0
Expand Down
14 changes: 7 additions & 7 deletions libexec/scoop-cleanup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
# -g, --global Cleanup a globally installed app
# -k, --cache Remove outdated download cache

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\install.ps1"

reset_aliases

Expand Down
14 changes: 7 additions & 7 deletions libexec/scoop-depends.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Usage: scoop depends <app>
# Summary: List dependencies for an app

. "$psscriptroot\..\lib\depends.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\decompress.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\depends.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\decompress.ps1"
. "$PSScriptRoot\..\lib\help.ps1"

reset_aliases

Expand Down
8 changes: 4 additions & 4 deletions libexec/scoop-download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# -u, --no-update-scoop Don't update Scoop before downloading if it's outdated
# -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it

. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"

reset_aliases

Expand Down
8 changes: 4 additions & 4 deletions libexec/scoop-export.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Summary: Exports (an importable) list of installed apps
# Help: Lists all installed apps.

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"

reset_aliases
$def_arch = default_architecture
Expand Down
6 changes: 3 additions & 3 deletions libexec/scoop-help.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Summary: Show help for a command
param($cmd)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\commands.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\commands.ps1"
. "$PSScriptRoot\..\lib\help.ps1"

reset_aliases

Expand Down
6 changes: 3 additions & 3 deletions libexec/scoop-hold.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Usage: scoop hold <apps>
# Summary: Hold an app to disable updates

. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"

reset_aliases
$apps = $args
Expand Down
8 changes: 4 additions & 4 deletions libexec/scoop-home.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Summary: Opens the app homepage
param($app)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"

reset_aliases

Expand Down
22 changes: 11 additions & 11 deletions libexec/scoop-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
# -s, --skip Skip hash validation (use with caution!)
# -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\decompress.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\shortcuts.ps1"
. "$psscriptroot\..\lib\psmodules.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\decompress.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\shortcuts.ps1"
. "$PSScriptRoot\..\lib\psmodules.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\depends.ps1"

reset_aliases

Expand Down
14 changes: 7 additions & 7 deletions libexec/scoop-reset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# if you've installed 'python' and 'python27', you can use 'scoop reset' to switch between
# using one or the other.

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\shortcuts.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\shortcuts.ps1"

reset_aliases
$opt, $apps, $err = getopt $args
Expand Down
8 changes: 4 additions & 4 deletions libexec/scoop-search.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# If used with [query], shows app names that match the query.
# Without [query], shows all the available apps.
param($query)
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"

reset_aliases

Expand Down
10 changes: 5 additions & 5 deletions libexec/scoop-status.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Usage: scoop status
# Summary: Show status and check for new app versions

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\depends.ps1"

reset_aliases

Expand Down
6 changes: 3 additions & 3 deletions libexec/scoop-unhold.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Usage: scoop unhold <app>
# Summary: Unhold an app to enable updates

. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"

reset_aliases
$apps = $args
Expand Down
20 changes: 10 additions & 10 deletions libexec/scoop-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
# -q, --quiet Hide extraneous messages
# -a, --all Update all apps (alternative to '*')

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\shortcuts.ps1"
. "$psscriptroot\..\lib\psmodules.ps1"
. "$psscriptroot\..\lib\decompress.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\shortcuts.ps1"
. "$PSScriptRoot\..\lib\psmodules.ps1"
. "$PSScriptRoot\..\lib\decompress.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\depends.ps1"
. "$PSScriptRoot\..\lib\install.ps1"

reset_aliases

Expand Down
18 changes: 9 additions & 9 deletions libexec/scoop-virustotal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
# -n, --no-depends By default, all dependencies are checked too. This flag avoids it.
# -u, --no-update-scoop Don't update Scoop before checking if it's outdated

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\getopt.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\json.ps1"
. "$psscriptroot\..\lib\decompress.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\json.ps1"
. "$PSScriptRoot\..\lib\decompress.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\depends.ps1"

reset_aliases

Expand Down
4 changes: 2 additions & 2 deletions libexec/scoop-which.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Summary: Locate a shim/executable (similar to 'which' on Linux)
# Help: Locate the path to a shim/executable that was installed with Scoop (similar to 'which' on Linux)
param($command)
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\help.ps1"

reset_aliases

Expand Down
2 changes: 1 addition & 1 deletion test/00-Project.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ Describe 'Project code' {

}

. "$psscriptroot\Import-File-Tests.ps1"
. "$PSScriptRoot\Import-File-Tests.ps1"
2 changes: 1 addition & 1 deletion test/Scoop-Alias.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. "$psscriptroot\..\libexec\scoop-alias.ps1" | Out-Null
. "$PSScriptRoot\..\libexec\scoop-alias.ps1" | Out-Null

reset_aliases

Expand Down
8 changes: 4 additions & 4 deletions test/Scoop-Core.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\unix.ps1"
. "$psscriptroot\Scoop-TestLib.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\unix.ps1"
. "$PSScriptRoot\Scoop-TestLib.ps1"

$repo_dir = (Get-Item $MyInvocation.MyCommand.Path).directory.parent.FullName
$isUnix = is_unix
Expand Down
Loading

0 comments on commit 63b858c

Please sign in to comment.