Skip to content

Commit 7e6be8f

Browse files
committed
Revert "chore(release): Bump to version 0.2.1 (#4960)"
This reverts commit 574bea4.
1 parent 574bea4 commit 7e6be8f

31 files changed

+258
-341
lines changed

CHANGELOG.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
## [v0.2.1](https://github.com/ScoopInstaller/Scoop/compare/v0.2.0...v0.2.1) - 2022-06-10
2-
3-
### Features
4-
5-
- **core:** Add pre_uninstall and post_uninstall hooks ([#4957](https://github.com/ScoopInstaller/Scoop/issues/4957), [#4962](https://github.com/ScoopInstaller/Scoop/issues/4962))
6-
7-
### Bug Fixes
8-
9-
- **bucket:** Make sure `list_buckets` return array ([#4979](https://github.com/ScoopInstaller/Scoop/issues/4979))
10-
- **chore:** Deprecate tls1 and tls1.1 ([#4950](https://github.com/ScoopInstaller/Scoop/issues/4950))
11-
- **chore:** Update Nonportable bucket URL ([#4955](https://github.com/ScoopInstaller/Scoop/issues/4955))
12-
- **core:** Using `Invoke-Command` instead of `Invoke-Expression` ([#4941](https://github.com/ScoopInstaller/Scoop/issues/4941))
13-
- **core:** Load config file before initialization ([#4932](https://github.com/ScoopInstaller/Scoop/issues/4932))
14-
- **core:** Allow to use '_' and '.' in bucket name ([#4952](https://github.com/ScoopInstaller/Scoop/issues/4952))
15-
- **depends:** Avoid digits in archive file extension (except for .7z and .001) ([#4915](https://github.com/ScoopInstaller/Scoop/issues/4915))
16-
- **bucket:** Don't check remote URL of non-git buckets ([#4923](https://github.com/ScoopInstaller/Scoop/issues/4923))
17-
- **bucket:** Don't write message OK before bucket is cloned ([#4925](https://github.com/ScoopInstaller/Scoop/issues/4925))
18-
- **shim:** Add 'Get-CommandPath()' to find git ([#4913](https://github.com/ScoopInstaller/Scoop/issues/4913))
19-
- **shim:** Remove character replacement in .cmd -> .ps1 shims ([#4914](https://github.com/ScoopInstaller/Scoop/issues/4914))
20-
- **scoop:** Pass CLI arguments as string objects ([#4931](https://github.com/ScoopInstaller/Scoop/issues/4931))
21-
- **scoop-info:** Fix error message when manifest is not found ([#4935](https://github.com/ScoopInstaller/Scoop/issues/4935))
22-
- **scoop-search:** Require files in 'bucket' dir for remote known buckets ([#4944](https://github.com/ScoopInstaller/Scoop/issues/4944))
23-
- **update:** Prevent uninstall when update ([#4949](https://github.com/ScoopInstaller/Scoop/issues/4949))
24-
- **scoop-download:** Use correct Args when calling `Get-Manifest` ([#4970](https://github.com/ScoopInstaller/Scoop/issues/4970))
25-
26-
### Code Refactoring
27-
28-
- **manifest:** Rename 'Find-Manifest()' to 'Get-Manifest() ([#4966](https://github.com/ScoopInstaller/Scoop/issues/4966), [#4981](https://github.com/ScoopInstaller/Scoop/issues/4981))
29-
30-
### Documentation
31-
32-
- **readme:** Update license badge ([#4929](https://github.com/ScoopInstaller/Scoop/issues/4929))
33-
341
## [v0.2.0](https://github.com/ScoopInstaller/Scoop/compare/v0.1.0...v0.2.0) - 2022-05-10
352

363
### Features

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<a href="https://gitter.im/lukesampson/scoop">
2828
<img src="https://badges.gitter.im/lukesampson/scoop.png" alt="Gitter Chat" />
2929
</a>
30-
<a href="./LICENSE">
31-
<img src="https://img.shields.io/badge/license-UNLICENSE%20or%20MIT-blue" alt="License" />
30+
<a href="https://github.com/ScoopInstaller/Scoop/blob/master/LICENSE">
31+
<img src="https://img.shields.io/github/license/ScoopInstaller/Scoop.svg" alt="License" />
3232
</a>
3333
</p>
3434

@@ -121,7 +121,7 @@ The following buckets are known to scoop:
121121
- [nerd-fonts](https://github.com/matthewjberger/scoop-nerd-fonts) - Nerd Fonts
122122
- [nirsoft](https://github.com/kodybrown/scoop-nirsoft) - Almost all of the [250+](https://rasa.github.io/scoop-directory/by-apps#kodybrown_scoop-nirsoft) apps from [Nirsoft](https://nirsoft.net)
123123
- [java](https://github.com/ScoopInstaller/Java) - A collection of Java development kits (JDKs), Java runtime engines (JREs), Java's virtual machine debugging tools and Java based runtime engines.
124-
- [nonportable](https://github.com/ScoopInstaller/Nonportable) - Non-portable apps (may require UAC)
124+
- [nonportable](https://github.com/TheRandomLabs/scoop-nonportable) - Non-portable apps (may require UAC)
125125
- [php](https://github.com/ScoopInstaller/PHP) - Installers for most versions of PHP
126126
- [versions](https://github.com/ScoopInstaller/Versions) - Alternative versions of apps found in other buckets
127127

bin/auto-pr.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if (is_unix) {
9696

9797
function execute($cmd) {
9898
Write-Host $cmd -ForegroundColor Green
99-
$output = Invoke-Command ([scriptblock]::Create($cmd))
99+
$output = Invoke-Expression $cmd
100100

101101
if ($LASTEXITCODE -gt 0) {
102102
abort "^^^ Error! See above ^^^ (last command: $cmd)"

bin/checkver.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ while ($in_progress -gt 0) {
221221
$page = $ev.SourceEventArgs.Result
222222
$err = $ev.SourceEventArgs.Error
223223
if ($json.checkver.script) {
224-
$page = Invoke-Command ([scriptblock]::Create($json.checkver.script -join "`r`n"))
224+
$page = $json.checkver.script -join "`r`n" | Invoke-Expression
225225
}
226226

227227
if ($err) {

bin/scoop.ps1

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
#Requires -Version 5
2+
param($SubCommand)
3+
24
Set-StrictMode -Off
35

46
. "$PSScriptRoot\..\lib\core.ps1"
57
. "$PSScriptRoot\..\lib\buckets.ps1"
68
. "$PSScriptRoot\..\lib\commands.ps1"
79
. "$PSScriptRoot\..\lib\help.ps1"
810

9-
$subCommand = $Args[0]
10-
1111
# for aliases where there's a local function, re-alias so the function takes precedence
1212
$aliases = Get-Alias | Where-Object { $_.Options -notmatch 'ReadOnly|AllScope' } | ForEach-Object { $_.Name }
1313
Get-ChildItem Function: | Where-Object -Property Name -In -Value $aliases | ForEach-Object {
1414
Set-Alias -Name $_.Name -Value Local:$($_.Name) -Scope Script
1515
}
1616

17-
switch ($subCommand) {
18-
({ $subCommand -in @($null, '-h', '--help', '/?') }) {
19-
exec 'help'
17+
switch ($SubCommand) {
18+
({ $SubCommand -in @($null, '--help', '/?') }) {
19+
if (!$SubCommand -and $Args -eq '-v') {
20+
$SubCommand = '--version'
21+
} else {
22+
exec 'help'
23+
}
2024
}
21-
({ $subCommand -in @('-v', '--version') }) {
25+
({ $SubCommand -eq '--version' }) {
2226
Write-Host 'Current Scoop version:'
2327
if ((Test-CommandAvailable git) -and (Test-Path "$PSScriptRoot\..\.git") -and (get_config SCOOP_BRANCH 'master') -ne 'master') {
24-
git -C "$PSScriptRoot\.." --no-pager log --oneline HEAD -n 1
28+
Invoke-Expression "git -C '$PSScriptRoot\..' --no-pager log --oneline HEAD -n 1"
2529
} else {
2630
$version = Select-String -Pattern '^## \[(v[\d.]+)\].*?([\d-]+)$' -Path "$PSScriptRoot\..\CHANGELOG.md"
2731
Write-Host $version.Matches.Groups[1].Value -ForegroundColor Cyan -NoNewline
@@ -31,23 +35,22 @@ switch ($subCommand) {
3135

3236
Get-LocalBucket | ForEach-Object {
3337
$bucketLoc = Find-BucketDirectory $_ -Root
34-
if ((Test-Path "$bucketLoc\.git") -and (Test-CommandAvailable git)) {
38+
if ((Test-Path (Join-Path $bucketLoc '.git')) -and (Test-CommandAvailable git)) {
3539
Write-Host "'$_' bucket:"
36-
git -C "$bucketLoc" --no-pager log --oneline HEAD -n 1
40+
Invoke-Expression "git -C '$bucketLoc' --no-pager log --oneline HEAD -n 1"
3741
Write-Host ''
3842
}
3943
}
4044
}
41-
({ $subCommand -in (commands) }) {
42-
[string[]]$arguments = $Args | Select-Object -Skip 1
43-
if ($null -ne $arguments -and $arguments[0] -in @('-h', '--help', '/?')) {
44-
exec 'help' @($subCommand)
45+
({ $SubCommand -in (commands) }) {
46+
if ($Args -in @('-h', '--help', '/?')) {
47+
exec 'help' @($SubCommand)
4548
} else {
46-
exec $subCommand $arguments
49+
exec $SubCommand $Args
4750
}
4851
}
4952
default {
50-
"scoop: '$subCommand' isn't a scoop command. See 'scoop help'."
53+
"scoop: '$SubCommand' isn't a scoop command. See 'scoop help'."
5154
exit 1
5255
}
5356
}

buckets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"nirsoft": "https://github.com/kodybrown/scoop-nirsoft",
66
"php": "https://github.com/ScoopInstaller/PHP",
77
"nerd-fonts": "https://github.com/matthewjberger/scoop-nerd-fonts",
8-
"nonportable": "https://github.com/ScoopInstaller/Nonportable",
8+
"nonportable": "https://github.com/TheRandomLabs/scoop-nonportable",
99
"java": "https://github.com/ScoopInstaller/Java",
1010
"games": "https://github.com/Calinou/scoop-games"
1111
}

lib/buckets.ps1

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,43 @@ function buckets {
7272
return Get-LocalBucket
7373
}
7474

75+
function Find-Manifest($app, $bucket) {
76+
$manifest, $url = $null, $null
77+
78+
# check if app is a URL or UNC path
79+
if ($app -match '^(ht|f)tps?://|\\\\') {
80+
$url = $app
81+
$app = appname_from_url $url
82+
$manifest = url_manifest $url
83+
} else {
84+
if ($bucket) {
85+
$manifest = manifest $app $bucket
86+
} else {
87+
foreach ($bucket in Get-LocalBucket) {
88+
$manifest = manifest $app $bucket
89+
if ($manifest) { break }
90+
}
91+
}
92+
93+
if (!$manifest) {
94+
# couldn't find app in buckets: check if it's a local path
95+
$path = $app
96+
if (!$path.endswith('.json')) { $path += '.json' }
97+
if (Test-Path $path) {
98+
$url = "$(Resolve-Path $path)"
99+
$app = appname_from_url $url
100+
$manifest, $bucket = url_manifest $url
101+
}
102+
}
103+
}
104+
105+
return $app, $manifest, $bucket, $url
106+
}
107+
75108
function Convert-RepositoryUri {
76109
[CmdletBinding()]
77110
param (
78111
[Parameter(Mandatory, Position = 0, ValueFromPipeline = $true)]
79-
[AllowEmptyString()]
80112
[String] $Uri
81113
)
82114

@@ -109,7 +141,7 @@ function list_buckets {
109141
Measure-Object | Select-Object -ExpandProperty Count
110142
$buckets += [PSCustomObject]$bucket
111143
}
112-
,$buckets
144+
$buckets
113145
}
114146

115147
function add_bucket($name, $repo) {
@@ -129,12 +161,10 @@ function add_bucket($name, $repo) {
129161
return 1
130162
}
131163
foreach ($bucket in Get-LocalBucket) {
132-
if (Test-Path -Path "$bucketsdir\$bucket\.git") {
133-
$remote = git -C "$bucketsdir\$bucket" config --get remote.origin.url
134-
if ((Convert-RepositoryUri -Uri $remote) -eq $uni_repo) {
135-
warn "Bucket $bucket already exists for $repo"
136-
return 2
137-
}
164+
$remote = git -C "$bucketsdir\$bucket" config --get remote.origin.url
165+
if ((Convert-RepositoryUri -Uri $remote) -eq $uni_repo) {
166+
warn "Bucket $bucket already exists for $repo"
167+
return 2
138168
}
139169
}
140170

@@ -144,10 +174,11 @@ function add_bucket($name, $repo) {
144174
error "'$repo' doesn't look like a valid git repository`n`nError given:`n$out"
145175
return 1
146176
}
177+
Write-Host 'OK'
178+
147179
ensure $bucketsdir | Out-Null
148180
$dir = ensure $dir
149181
git_cmd clone "$repo" "`"$dir`"" -q
150-
Write-Host 'OK'
151182
success "The $name bucket was added successfully."
152183
return 0
153184
}
@@ -164,12 +195,12 @@ function rm_bucket($name) {
164195
}
165196

166197
function new_issue_msg($app, $bucket, $title, $body) {
167-
$app, $manifest, $bucket, $url = Get-Manifest "$bucket/$app"
198+
$app, $manifest, $bucket, $url = Find-Manifest $app $bucket
168199
$url = known_bucket_repo $bucket
169200
$bucket_path = "$bucketsdir\$bucket"
170201

171202
if (Test-Path $bucket_path) {
172-
$remote = git -C "$bucket_path" config --get remote.origin.url
203+
$remote = Invoke-Expression "git -C '$bucket_path' config --get remote.origin.url"
173204
# Support ssh and http syntax
174205
# git@PROVIDER:USER/REPO.git
175206
# https://PROVIDER/USER/REPO.git

lib/commands.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function command_path($cmd) {
2020
$shim_path = "$scoopdir\shims\scoop-$cmd.ps1"
2121
$line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
2222
if($line) {
23-
Invoke-Command ([scriptblock]::Create($line)) -NoNewScope
23+
Invoke-Expression -command "$line"
2424
$cmd_path = $path
2525
}
2626
else { $cmd_path = $shim_path }

0 commit comments

Comments
 (0)