forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add $version for manifest_path (#149)
- Loading branch information
Showing
7 changed files
with
177 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
. "$PSScriptRoot\Scoop-TestLib.ps1" | ||
. "$PSScriptRoot\..\lib\core.ps1" | ||
. "$PSScriptRoot\..\lib\manifest.ps1" | ||
|
||
Describe 'Resolve-ManifestInformation' -Tag 'Scoop' { | ||
BeforeAll { | ||
$working_dir = (setup_working 'manifest' | Resolve-Path).Path | ||
Move-Item "$working_dir\*.*" "$working_dir\bucket" | ||
$SCOOP_BUCKETS_DIRECTORY = $working_dir | Split-Path | ||
|
||
Copy-Item $working_dir "$SCOOP_BUCKETS_DIRECTORY\ash258.ash258" -Force -Recurse | ||
Copy-Item $working_dir "$SCOOP_BUCKETS_DIRECTORY\main" -Force -Recurse | ||
} | ||
|
||
It 'manifest_path' { | ||
$path = manifest_path 'cosi' 'manifest' | ||
$path | Should -Be "$working_dir\bucket\cosi.yaml" | ||
$path = $null | ||
|
||
$path = manifest_path 'wget' 'manifest' | ||
$path | Should -Be "$working_dir\bucket\wget.json" | ||
$path = $null | ||
|
||
$path = manifest_path 'pwsh' 'ash258.ash258' | ||
$path | Should -Be "$SCOOP_BUCKETS_DIRECTORY\ash258.ash258\bucket\pwsh.json" | ||
$path = $null | ||
|
||
$path = manifest_path 'cosi' 'main' | ||
$path | Should -Be "$SCOOP_BUCKETS_DIRECTORY\main\bucket\cosi.yaml" | ||
$path = $null | ||
|
||
$path = manifest_path 'pwsh' 'alfa' | ||
$path | Should -Be $null | ||
$path = $null | ||
|
||
$path = manifest_path 'ahoj' 'main' | ||
$path | Should -Be $null | ||
$path = $null | ||
} | ||
|
||
It 'manifest_path with version' { | ||
$path = manifest_path 'cosi' 'main' '7.1.0' | ||
$path | Should -Be "$SCOOP_BUCKETS_DIRECTORY\main\bucket\old\cosi\7.1.0.yaml" | ||
$path = $null | ||
|
||
$path = manifest_path 'pwsh' 'ash258.ash258' '6.2.3' | ||
$path | Should -Be "$SCOOP_BUCKETS_DIRECTORY\ash258.ash258\bucket\old\pwsh\6.2.3.yml" | ||
$path = $null | ||
|
||
$path = manifest_path 'pwsh' 'ash258.ash258' '2222' | ||
$path | Should -Be $null | ||
$path = $null | ||
|
||
{ manifest_path 'wget' 'ash258.ash258' '2222' } | Should -Throw 'Bucket ''ash258.ash258'' does not contain archived version ''2222'' for ''wget''' | ||
$path = $null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 7.1.3 | ||
description: Cross-platform automation and configuration tool/framework, known as Powershell Core, that works well with existing tools and is optimized for dealing with structured data. | ||
homepage: https://github.com/PowerShell/PowerShell | ||
license: MIT | ||
architecture: | ||
64bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x64.zip | ||
hash: 47475f1d4015704f3fb5f6d2cf61196d121aba60c19592b04be818317ce01039 | ||
32bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x86.zip | ||
hash: ecfd51545084d9b791874062c39eb0c7c7dd2991265ee7f4dc5064995a614e6c | ||
bin: pwsh.exe | ||
shortcuts: | ||
- - pwsh.exe | ||
- PowerShell Core | ||
checkver: github | ||
autoupdate: | ||
archive: true | ||
architecture: | ||
64bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x64.zip | ||
32bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x86.zip | ||
hash: | ||
url: https://github.com/PowerShell/PowerShell/releases/tag/v$version/ | ||
regex: $basename\s*<ul>\s*<li>$sha256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 7.1.0 | ||
description: Cross-platform automation and configuration tool/framework, known as Powershell Core, that works well with existing tools and is optimized for dealing with structured data. | ||
homepage: https://github.com/PowerShell/PowerShell | ||
license: MIT | ||
architecture: | ||
64bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/PowerShell-7.1.0-win-x64.zip | ||
hash: c86f260f92b31d4e8e30b1ebbeb09e13364fc095ecf1538d9a8cec18d21d5d32 | ||
32bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/PowerShell-7.1.0-win-x86.zip | ||
hash: 3d0f768573317a0f69dab4f924b772ee947828d89cbf6bf5c7242b45a3800fbc | ||
bin: pwsh.exe | ||
shortcuts: | ||
- - pwsh.exe | ||
- PowerShell Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 6.2.3 | ||
description: Cross-platform automation and configuration tool/framework, known as Powershell Core, that works well with existing tools and is optimized for dealing with structured data. | ||
homepage: https://github.com/PowerShell/PowerShell | ||
license: MIT | ||
architecture: | ||
64bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/PowerShell-6.2.3-win-x64.zip | ||
hash: af171ed197b167e2630044dba6344af8b291e8646f7276b63f1d84c166a41d33 | ||
32bit: | ||
url: https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/PowerShell-6.2.3-win-x86.zip | ||
hash: 6b9f1c54755aa51678e56a6059c2747801b3e0c72e678b800b15c8e084129c66 | ||
bin: pwsh.exe | ||
shortcuts: | ||
- - pwsh.exe | ||
- PowerShell Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"version": "7.1.3", | ||
"description": "Cross-platform automation and configuration tool/framework, known as Powershell Core, that works well with existing tools and is optimized for dealing with structured data.", | ||
"homepage": "https://github.com/PowerShell/PowerShell", | ||
"license": "MIT", | ||
"architecture": { | ||
"64bit": { | ||
"url": "https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x64.zip", | ||
"hash": "47475f1d4015704f3fb5f6d2cf61196d121aba60c19592b04be818317ce01039" | ||
}, | ||
"32bit": { | ||
"url": "https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x86.zip", | ||
"hash": "ecfd51545084d9b791874062c39eb0c7c7dd2991265ee7f4dc5064995a614e6c" | ||
} | ||
}, | ||
"bin": "pwsh.exe", | ||
"shortcuts": [ | ||
[ | ||
"pwsh.exe", | ||
"PowerShell Core" | ||
] | ||
], | ||
"checkver": "github", | ||
"autoupdate": { | ||
"archive": true, | ||
"architecture": { | ||
"64bit": { | ||
"url": "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x64.zip" | ||
}, | ||
"32bit": { | ||
"url": "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x86.zip" | ||
} | ||
}, | ||
"hash": { | ||
"url": "https://github.com/PowerShell/PowerShell/releases/tag/v$version/", | ||
"regex": "$basename\\s*<ul>\\s*<li>$sha256" | ||
} | ||
} | ||
} |