Skip to content

Commit 859d1db

Browse files
niheavenmattcargileccyykkcyk
authored
chore(release): Bump to version 0.5.2 (#6080)
Co-authored-by: Hsiao-nan Cheung <[email protected]> Co-authored-by: Matt Cargile <[email protected]> Co-authored-by: ccyykkcyk <[email protected]>
2 parents be56faf + c7ec5c8 commit 859d1db

13 files changed

+44
-34
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [v0.5.2](https://github.com/ScoopInstaller/Scoop/compare/v0.5.1...v0.5.2) - 2024-07-26
2+
3+
### Bug Fixes
4+
5+
- **scoop-alias:** Fix 'Option --verbose not recognized.' ([#6062](https://github.com/ScoopInstaller/Scoop/issues/6062))
6+
- **scoop-hold:** Use 'foreach' loop to allow 'continue' statement ([#6078](https://github.com/ScoopInstaller/Scoop/issues/6078))
7+
- **core:** Use 'Join-Path' to construct cache file path ([#6079](https://github.com/ScoopInstaller/Scoop/issues/6079))
8+
- **json:** Don't serialize jsonpath return if only one result ([#6066](https://github.com/ScoopInstaller/Scoop/issues/6066), [#6073](https://github.com/ScoopInstaller/Scoop/issues/6073))
9+
10+
### Builds
11+
12+
- **supporting:** Update Json.Schema to 4.0.1 ([#6072](https://github.com/ScoopInstaller/Scoop/issues/6072))
13+
114
## [v0.5.1](https://github.com/ScoopInstaller/Scoop/compare/v0.5.0...v0.5.1) - 2024-07-16
215

316
### Bug Fixes

lib/core.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ function usermanifestsdir { "$(basedir)\workspace" }
407407
function usermanifest($app) { "$(usermanifestsdir)\$app.json" }
408408
function cache_path($app, $version, $url) {
409409
$underscoredUrl = $url -replace '[^\w\.\-]+', '_'
410-
$filePath = "$cachedir\$app#$version#$underscoredUrl"
410+
$filePath = Join-Path $cachedir "$app#$version#$underscoredUrl"
411411

412412
# NOTE: Scoop cache files migration. Remove this 6 months after the feature ships.
413413
if (Test-Path $filePath) {

lib/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function Invoke-CachedAria2Download ($app, $version, $manifest, $architecture, $
238238

239239
foreach ($url in $urls) {
240240
$data.$url = @{
241-
'target' = "$dir\$(url_filename $url)"
241+
'target' = Join-Path $dir (url_filename $url)
242242
'cachename' = fname (cache_path $app $version $url)
243243
'source' = cache_path $app $version $url
244244
}

lib/json.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function json_path([String] $json, [String] $jsonpath, [Hashtable] $substitution
110110
# Return versions in reverse order
111111
$result = [System.Linq.Enumerable]::Reverse($result)
112112
}
113-
if ($single) {
113+
if ([System.Linq.Enumerable]::Count($result) -eq 1 -or $single) {
114114
# Extract First value
115115
$result = [System.Linq.Enumerable]::First($result)
116116
# Convert first value to string

libexec/scoop-alias.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if ($SubCommand -notin $SubCommands) {
3939
exit 1
4040
}
4141

42-
$opt, $other, $err = getopt $Args 'v' , 'verbose'
42+
$opt, $other, $err = getopt $Args 'v' 'verbose'
4343
if ($err) { "scoop alias: $err"; exit 1 }
4444

4545
$name, $command, $description = $other

libexec/scoop-hold.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,21 @@ if ($global -and !(is_admin)) {
2929
exit 1
3030
}
3131

32-
$apps | ForEach-Object {
33-
$app = $_
32+
foreach ($app in $apps) {
3433

3534
if ($app -eq 'scoop') {
3635
$hold_update_until = [System.DateTime]::Now.AddDays(1)
3736
set_config HOLD_UPDATE_UNTIL $hold_update_until.ToString('o') | Out-Null
3837
success "$app is now held and might not be updated until $($hold_update_until.ToLocalTime())."
39-
return
38+
continue
4039
}
4140
if (!(installed $app $global)) {
4241
if ($global) {
4342
error "'$app' is not installed globally."
4443
} else {
4544
error "'$app' is not installed."
4645
}
47-
return
46+
continue
4847
}
4948

5049
if (get_config NO_JUNCTION) {

libexec/scoop-virustotal.ps1

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636

3737
$opt, $apps, $err = getopt $args 'asnup' @('all', 'scan', 'no-depends', 'no-update-scoop', 'passthru')
3838
if ($err) { "scoop virustotal: $err"; exit 1 }
39-
if (!$apps -and -$all) { my_usage; exit 1 }
40-
$architecture = Format-ArchitectureString
39+
$all = $apps -eq '*' -or $opt.a -or $opt.all
40+
if (!$apps -and !$all) { my_usage; exit 1 }
41+
$architecture = Get-DefaultArchitecture
4142

4243
if (is_scoop_outdated) {
4344
if ($opt.u -or $opt.'no-update-scoop') {
@@ -47,11 +48,8 @@ if (is_scoop_outdated) {
4748
}
4849
}
4950

50-
$apps_param = $apps
51-
52-
if ($apps_param -eq '*' -or $opt.a -or $opt.all) {
53-
$apps = installed_apps $false
54-
$apps += installed_apps $true
51+
if ($all) {
52+
$apps = (installed_apps $false) + (installed_apps $true)
5553
}
5654

5755
if (!$opt.n -and !$opt.'no-depends') {
@@ -102,14 +100,14 @@ Function Get-VirusTotalResultByHash ($hash, $url, $app) {
102100
$response = Invoke-WebRequest -Uri $api_url -Method GET -Headers $headers -UseBasicParsing
103101
$result = $response.Content
104102
$stats = json_path $result '$.data.attributes.last_analysis_stats'
105-
[int]$malicious = json_path $stats '$[0].malicious' $null $false $true
106-
[int]$suspicious = json_path $stats '$[0].suspicious' $null $false $true
107-
[int]$timeout = json_path $stats '$[0].timeout' $null $false $true
108-
[int]$undetected = json_path $stats '$[0].undetected' $null $false $true
103+
[int]$malicious = json_path $stats '$.malicious'
104+
[int]$suspicious = json_path $stats '$.suspicious'
105+
[int]$timeout = json_path $stats '$.timeout'
106+
[int]$undetected = json_path $stats '$.undetected'
109107
[int]$unsafe = $malicious + $suspicious
110108
[int]$total = $unsafe + $undetected
111-
[int]$fileSize = json_path $result '$.data.attributes.size' $null $false $true
112-
$report_hash = json_path $result '$.data.attributes.sha256' $null $false $true
109+
[int]$fileSize = json_path $result '$.data.attributes.size'
110+
$report_hash = json_path $result '$.data.attributes.sha256'
113111
$report_url = "https://www.virustotal.com/gui/file/$report_hash"
114112
if ($total -eq 0) {
115113
info "$app`: Analysis in progress."
21 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
e1e27af7b07eeedf5ce71a9255f0422816a6fc5849a483c6714e1b472044fa9d *Newtonsoft.Json.dll
2-
9f1a8f06c284a4ee01f704d89003ddc7061846f2008094071e9adf08267849f9 *Newtonsoft.Json.Schema.dll
3-
d11b660612ce821ec03772b73aa3b8884a0479275c70085c7e143913a41a2d28 *Scoop.Validator.dll
2+
7496d5349a123a6e3696085662b2ff17b156ccdb0e30e0c396ac72d2da36ce1c *Newtonsoft.Json.Schema.dll
3+
83b1006443e8c340ca4c631614fc2ce0d5cb9a28c851e3b59724299f58b1397f *Scoop.Validator.dll
44
87f8f8db2202a3fbef6f431d0b7e20cec9d32095c441927402041f3c4076c1b6 *validator.exe

0 commit comments

Comments
 (0)