Skip to content

Instantly share code, notes, and snippets.

@HUMORCE
Created July 11, 2023 02:13
Show Gist options
  • Save HUMORCE/4e215c95bdcbb9d17a6b0cda777b6331 to your computer and use it in GitHub Desktop.
Save HUMORCE/4e215c95bdcbb9d17a6b0cda777b6331 to your computer and use it in GitHub Desktop.
Tests of get-manifest()
. "$(scoop prefix scoop)\lib\core.ps1"
$main_bucket = Resolve-Path "$(scoop prefix scoop)\..\..\..\buckets\main\bucket"
scoop uninstall app appd localmanifest ag
clear-host
# create manifest for test
$manifest_1 = '{
"version": "1",
"url": "http://example.org/#/App.exe"
}'
$manifest_1 | out-file "~\desktop\app.json" -Encoding ascii
$manifest_1 | out-file "localmanifest.json" -Encoding ascii
'{
"version": "1.0",
"url": "https://example.org/#/app.exe",
"depends": "yyyxxx/depend_app"
}' | out-file "$main_bucket\appd.json" -Encoding ascii
# installation tests
info '>>> scoop install ag'
scoop install ag
info '>>> scoop uninstall ag'
scoop uninstall ag
info '>>> scoop install ag@2.2.4'
scoop install ag@2.2.4
info '>>> scoop uninstall ag'
scoop uninstall ag
info '>>> scoop install main/ag@2.2.4'
scoop install main/ag@2.2.4
## Non-existent in any buckets
info '>>> scoop install xxx'
scoop install xxx
## Non-existent in main bucket
info '>>> scoop install main/xxx'
scoop install main/xxx
## bucket 'yyy' not added
info '>>> scoop install yyy/xxx'
scoop install yyy/xxx
## Non-existent remote manifest
info '>>> scoop install http://0.0.0.0/xxx.json'
scoop install http://0.0.0.0/xxx.json
## Non-existent local manifest
info '>>> scoop install .\xxx.json'
scoop install .\xxx.json
info '>>> scoop install C:\xxx.json'
scoop install C:\xxx.json
## local manifest
info '>>> scoop install ~\desktop\app.json'
scoop install ~\desktop\app.json
## manifest with Non-existent dependency
info '>>> scoop install appd'
scoop install appd
## Non-existent in any buckets but it is a local manifest in current dir
info '>>> scoop install localmanifest'
scoop install localmanifest
## local manifest in current dir with postfix
info '>>> scoop install localmanifest.json'
scoop install localmanifest.json
remove-item "~\desktop\app.json", "localmanifest.json", "$main_bucket\appd.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment