Skip to content

Commit 80b52e3

Browse files
authored
chore(release): Bump to version 0.2.3
Merge pull request #5031 from ScoopInstaller/develop
2 parents 93db5f4 + b4e0ff1 commit 80b52e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+529
-312
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
## [v0.2.3](https://github.com/ScoopInstaller/Scoop/compare/v0.2.2...v0.2.3) - 2022-07-07
2+
3+
### Features
4+
5+
- **chore:** Add missing -a/--all param to all commands ([#5004](https://github.com/ScoopInstaller/Scoop/issues/5004))
6+
- **scoop-status:** Check bucket status, improve output ([#5011](https://github.com/ScoopInstaller/Scoop/issues/5011))
7+
- **scoop-info:** Show app installed/download size ([#4886](https://github.com/ScoopInstaller/Scoop/issues/4886))
8+
- **scoop-import:** Import a Scoop installation from JSON ([#5014](https://github.com/ScoopInstaller/Scoop/issues/5014), [#5034](https://github.com/ScoopInstaller/Scoop/issues/5034))
9+
10+
### Bug Fixes
11+
12+
- **chore:** Update help documentation ([#5002](https://github.com/ScoopInstaller/Scoop/issues/5002), [#5029](https://github.com/ScoopInstaller/Scoop/issues/5029))
13+
- **decompress:** Handle split RAR archives ([#4994](https://github.com/ScoopInstaller/Scoop/issues/4994))
14+
- **shortcuts:** Fix network drive shortcut creation ([#4410](https://github.com/ScoopInstaller/Scoop/issues/4410), [#5006](https://github.com/ScoopInstaller/Scoop/issues/5006))
15+
16+
### Code Refactoring
17+
18+
- **scoop-search:** Output PSObject, use API token ([#4997](https://github.com/ScoopInstaller/Scoop/issues/4997))
19+
20+
### Builds
21+
22+
- **checkver,auto-pr:** Allow passing file path ([#5019](https://github.com/ScoopInstaller/Scoop/issues/5019))
23+
- **checkver:** Exit routine earlier if error ([#5025](https://github.com/ScoopInstaller/Scoop/issues/5025))
24+
- **json:** Update Newton.Json to 13.0.1 ([#5026](https://github.com/ScoopInstaller/Scoop/issues/5026))
25+
26+
### Tests
27+
28+
- **typo:** Fix typo ('formated' -> 'formatted') ([#4217](https://github.com/ScoopInstaller/Scoop/issues/4217))
29+
130
## [v0.2.2](https://github.com/ScoopInstaller/Scoop/compare/v0.2.1...v0.2.2) - 2022-06-21
231

332
### Features

bin/auto-pr.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ param(
4343
[String] $Upstream,
4444
[String] $OriginBranch = 'master',
4545
[String] $App = '*',
46-
[Parameter(Mandatory = $true)]
4746
[ValidateScript( {
4847
if (!(Test-Path $_ -Type Container)) {
4948
throw "$_ is not a directory!"
@@ -64,7 +63,13 @@ param(
6463
. "$PSScriptRoot\..\lib\json.ps1"
6564
. "$PSScriptRoot\..\lib\unix.ps1"
6665

67-
$Dir = Resolve-Path $Dir
66+
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
67+
$Dir = Split-Path $App
68+
} elseif ($Dir) {
69+
$Dir = Resolve-Path $Dir
70+
} else {
71+
throw "'-Dir' parameter required if '-App' is not a filepath!"
72+
}
6873

6974
if ((!$Push -and !$Request) -or $Help) {
7075
Write-Host @'

bin/checkver.ps1

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#>
5353
param(
5454
[String] $App = '*',
55-
[Parameter(Mandatory = $true)]
5655
[ValidateScript( {
5756
if (!(Test-Path $_ -Type Container)) {
5857
throw "$_ is not a directory!"
@@ -77,8 +76,16 @@ param(
7776
. "$PSScriptRoot\..\lib\install.ps1" # needed for hash generation
7877
. "$PSScriptRoot\..\lib\unix.ps1"
7978

80-
$Dir = Resolve-Path $Dir
81-
$Search = $App
79+
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
80+
$Dir = Split-Path $App
81+
$files = Get-ChildItem $Dir (Split-Path $App -Leaf)
82+
} elseif ($Dir) {
83+
$Dir = Resolve-Path $Dir
84+
$files = Get-ChildItem $Dir "$App.json"
85+
} else {
86+
throw "'-Dir' parameter required if '-App' is not a filepath!"
87+
}
88+
8289
$GitHubToken = Get-GitHubToken
8390

8491
# don't use $Version with $App = '*'
@@ -89,17 +96,16 @@ if ($App -eq '*' -and $Version -ne '') {
8996
# get apps to check
9097
$Queue = @()
9198
$json = ''
92-
Get-ChildItem $Dir "$App.json" | ForEach-Object {
99+
$files | ForEach-Object {
93100
$json = parse_json "$Dir\$($_.Name)"
94101
if ($json.checkver) {
95102
$Queue += , @($_.Name, $json)
96103
}
97104
}
98105

99106
# clear any existing events
100-
Get-Event | ForEach-Object {
101-
Remove-Event $_.SourceIdentifier
102-
}
107+
Get-Event | Remove-Event
108+
Get-EventSubscriber | Unregister-Event
103109

104110
# start all downloads
105111
$Queue | ForEach-Object {
@@ -218,20 +224,20 @@ while ($in_progress -gt 0) {
218224
$ver = $Version
219225

220226
if (!$ver) {
221-
$page = (Get-Encoding($wc)).GetString($ev.SourceEventArgs.Result)
222-
$err = $ev.SourceEventArgs.Error
223-
if ($json.checkver.script) {
224-
$page = Invoke-Command ([scriptblock]::Create($json.checkver.script -join "`r`n"))
227+
if (!$regex -and $replace) {
228+
next "'replace' requires 're' or 'regex'"
229+
continue
225230
}
226-
231+
$err = $ev.SourceEventArgs.Error
227232
if ($err) {
228233
next "$($err.message)`r`nURL $url is not valid"
229234
continue
230235
}
231236

232-
if (!$regex -and $replace) {
233-
next "'replace' requires 're' or 'regex'"
234-
continue
237+
if ($json.checkver.script) {
238+
$page = Invoke-Command ([scriptblock]::Create($json.checkver.script -join "`r`n"))
239+
} else {
240+
$page = (Get-Encoding($wc)).GetString($ev.SourceEventArgs.Result)
235241
}
236242

237243
if ($jsonpath) {

bin/scoop.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ switch ($subCommand) {
4747
}
4848
}
4949
default {
50-
"scoop: '$subCommand' isn't a scoop command. See 'scoop help'."
50+
warn "scoop: '$subCommand' isn't a scoop command. See 'scoop help'."
5151
exit 1
5252
}
5353
}

lib/buckets.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function add_bucket($name, $repo) {
120120

121121
$dir = Find-BucketDirectory $name -Root
122122
if (Test-Path $dir) {
123-
warn "The '$name' bucket already exists. Use 'scoop bucket rm $name' to remove it."
123+
warn "The '$name' bucket already exists. To add this bucket again, first remove it by running 'scoop bucket rm $name'."
124124
return 2
125125
}
126126

lib/decompress.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ function Expand-7zipArchive {
6767
if (($Path -replace '.*\.([^\.]*)$', '$1') -eq '001') {
6868
# Remove splited 7-zip archive parts
6969
Get-ChildItem "$($Path -replace '\.[^\.]*$', '').???" | Remove-Item -Force
70+
} elseif (($Path -replace '.*\.part(\d+)\.rar$', '$1')[-1] -eq '1') {
71+
# Remove splitted RAR archive parts
72+
Get-ChildItem "$($Path -replace '\.part(\d+)\.rar$', '').part*.rar" | Remove-Item -Force
7073
} else {
7174
Remove-Item $Path -Force
7275
}

lib/manifest.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ function manifest_path($app, $bucket) {
33
}
44

55
function parse_json($path) {
6-
if(!(test-path $path)) { return $null }
7-
Get-Content $path -raw -Encoding UTF8 | convertfrom-json -ea stop
6+
if (!(Test-Path $path)) { return $null }
7+
try {
8+
Get-Content $path -Raw -Encoding UTF8 | ConvertFrom-Json -ErrorAction Stop
9+
} catch {
10+
warn "Error parsing JSON at $path."
11+
}
812
}
913

1014
function url_manifest($url) {
@@ -20,7 +24,11 @@ function url_manifest($url) {
2024
throw
2125
}
2226
if(!$str) { return $null }
23-
$str | convertfrom-json
27+
try {
28+
$str | ConvertFrom-Json -ErrorAction Stop
29+
} catch {
30+
warn "Error parsing JSON at $url."
31+
}
2432
}
2533

2634
function Get-Manifest($app) {

lib/shortcuts.ps1

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ function create_startmenu_shortcuts($manifest, $dir, $global, $arch) {
2020
}
2121

2222
function shortcut_folder($global) {
23-
$directory = [System.IO.Path]::Combine([Environment]::GetFolderPath('startmenu'), 'Programs', 'Scoop Apps')
24-
if($global) {
25-
$directory = [System.IO.Path]::Combine([Environment]::GetFolderPath('commonstartmenu'), 'Programs', 'Scoop Apps')
23+
if ($global) {
24+
$startmenu = 'CommonStartMenu'
25+
} else {
26+
$startmenu = 'StartMenu'
2627
}
27-
return $(ensure $directory)
28+
return Convert-Path (ensure ([System.IO.Path]::Combine([Environment]::GetFolderPath($startmenu), 'Programs', 'Scoop Apps')))
2829
}
2930

3031
function startmenu_shortcut([System.IO.FileInfo] $target, $shortcutName, $arguments, [System.IO.FileInfo]$icon, $global) {
@@ -67,18 +68,5 @@ function rm_startmenu_shortcuts($manifest, $global, $arch) {
6768
if(Test-Path -Path $shortcut) {
6869
Remove-Item $shortcut
6970
}
70-
# Before issue 1514 Startmenu shortcut removal
71-
#
72-
# Shortcuts that should have been installed globally would
73-
# have been installed locally up until 27 June 2017.
74-
#
75-
# TODO: Remove this 'if' block and comment after
76-
# 27 June 2018.
77-
if($global) {
78-
$shortcut = "$(shortcut_folder $false)\$name.lnk"
79-
if(Test-Path -Path $shortcut) {
80-
Remove-Item $shortcut
81-
}
82-
}
8371
}
8472
}

libexec/scoop-alias.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ function add_alias($name, $command) {
5252
# generate script
5353
$shimdir = shimdir $false
5454
$script =
55-
@"
56-
# Summary: $description
57-
$command
58-
"@
55+
@(
56+
"# Summary: $description",
57+
"$command"
58+
) -join "`r`n"
5959
$script | Out-UTF8File "$shimdir\$alias_file.ps1"
6060

6161
# add alias to config

libexec/scoop-cache.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#
1111
# To clear everything in your cache, use:
1212
# scoop cache rm *
13+
# You can also use the `-a/--all` switch in place of `*` here
14+
1315
param($cmd)
1416

1517
function cacheinfo($file) {
@@ -36,7 +38,7 @@ function cacheremove($app) {
3638
'ERROR: <app(s)> missing'
3739
my_usage
3840
exit 1
39-
} elseif ($app -eq '*') {
41+
} elseif ($app -eq '*' -or $app -eq '-a' -or $app -eq '--all') {
4042
$files = @(Get-ChildItem $cachedir)
4143
} else {
4244
$app = '(' + ($app -join '|') + ')'

0 commit comments

Comments
 (0)