Skip to content

Commit cfb2ef3

Browse files
committed
Merge branch 'develop' into issaclin32-rar
2 parents 3a8c877 + 9811a5f commit cfb2ef3

29 files changed

Lines changed: 318 additions & 168 deletions

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,36 @@
22

33
### Features
44

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+
9+
### Bug Fixes
10+
11+
- **chore:** Update help documentation ([#5002](https://github.com/ScoopInstaller/Scoop/issues/5002))
12+
- **decompress:** Handle splitted RAR archives ([#4994](https://github.com/ScoopInstaller/Scoop/issues/4994))
13+
- **shortcuts:** Fix network drive shortcut creation ([#4410](https://github.com/ScoopInstaller/Scoop/issues/4410)), ([#5006](https://github.com/ScoopInstaller/Scoop/issues/5006))
14+
15+
### Code Refactoring
16+
17+
- **scoop-search:** Output PSObject, use API token ([#4997](https://github.com/ScoopInstaller/Scoop/issues/4997))
18+
19+
### Tests
20+
21+
- **typo:** Fix typo ('formated' -> 'formatted') ([#4217](https://github.com/ScoopInstaller/Scoop/issues/4217))
22+
23+
## [v0.2.2](https://github.com/ScoopInstaller/Scoop/compare/v0.2.1...v0.2.2) - 2022-06-21
24+
25+
### Features
26+
527
- **core:** Add `Get-Encoding` function to fix missing webclient encoding ([#4956](https://github.com/ScoopInstaller/Scoop/issues/4956))
6-
- **scoop-virustotal:** Migrate to virustotal api v3, improve flows, and ouput powershell objects ([#4983](https://github.com/ScoopInstaller/Scoop/pull/4983))
7-
- **scoop-hold,scoop-unhold:** Support `-g`/`--global` flag ([#4991](https://github.com/ScoopInstaller/Scoop/issues/4991))
28+
- **scoop-(un)hold:** Add `-g`/`--global` flag ([#4991](https://github.com/ScoopInstaller/Scoop/issues/4991))
29+
- **scoop-update:** Support `scoop update scoop` ([#4992](https://github.com/ScoopInstaller/Scoop/issues/4992))
30+
- **scoop-virustotal:** Migrate to VirusTotal API v3 ([#4983](https://github.com/ScoopInstaller/Scoop/issues/4983))
831

932
### Bug Fixes
1033

1134
- **manifest:** Fix bugs in 'Get-Manifest()' ([#4986](https://github.com/ScoopInstaller/Scoop/issues/4986))
12-
- **decompress:** Handle splitted RAR archives ([#4994](https://github.com/ScoopInstaller/Scoop/pull/4994))
1335

1436
## [v0.2.1](https://github.com/ScoopInstaller/Scoop/compare/v0.2.0...v0.2.1) - 2022-06-10
1537

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/core.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ function Confirm-InstallationStatus {
855855
$Global
856856
)
857857
$Installed = @()
858-
$Apps | Select-Object -Unique | Where-Object { $_.Name -ne 'scoop' } | ForEach-Object {
858+
$Apps | Select-Object -Unique | Where-Object { $_ -ne 'scoop' } | ForEach-Object {
859859
$App, $null, $null = parse_app $_
860860
if ($Global) {
861861
if (Test-Path (appdir $App $true)) {

lib/manifest.ps1

Lines changed: 6 additions & 2 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 manifest at $path."
11+
}
812
}
913

1014
function url_manifest($url) {

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 '|') + ')'

libexec/scoop-depends.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Usage: scoop depends <app>
2-
# Summary: List dependencies for an app
2+
# Summary: List dependencies for an app, in the order they'll be installed
33

44
. "$PSScriptRoot\..\lib\getopt.ps1"
55
. "$PSScriptRoot\..\lib\depends.ps1" # 'Get-Dependency'
@@ -17,9 +17,12 @@ try {
1717
abort "ERROR: $_"
1818
}
1919

20-
$deps = @(Get-Dependency $app $architecture) -ne $app
21-
if($deps) {
22-
$deps[($deps.length - 1)..0]
20+
$deps = @()
21+
Get-Dependency $app $architecture | ForEach-Object {
22+
$dep = [ordered]@{}
23+
$dep.Source, $dep.Name = $_ -split '/'
24+
$deps += [PSCustomObject]$dep
2325
}
26+
$deps
2427

2528
exit 0

libexec/scoop-download.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Help: e.g. The usual way to download an app, without installing it (uses your local 'buckets'):
44
# scoop download git
55
#
6+
# To download a different version of the app
7+
# (note that this will auto-generate the manifest using current version):
8+
# scoop download gh@2.7.0
9+
#
610
# To download an app from a manifest at a URL:
711
# scoop download https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/runat.json
812
#

libexec/scoop-help.ps1

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,42 @@
33
param($cmd)
44

55
function print_help($cmd) {
6-
$file = Get-Content (command_path $cmd) -raw
6+
$file = Get-Content (command_path $cmd) -Raw
77

88
$usage = usage $file
9-
$summary = summary $file
109
$help = scoop_help $file
1110

12-
if($usage) { "$usage`n" }
13-
if($help) { $help }
11+
if ($usage) { "$usage`n" }
12+
if ($help) { $help }
1413
}
1514

1615
function print_summaries {
17-
$commands = @{}
16+
$commands = @()
1817

1918
command_files | ForEach-Object {
20-
$command = command_name $_
21-
$summary = summary (Get-Content (command_path $command) -raw)
22-
if(!($summary)) { $summary = '' }
23-
$commands.add("$command ", $summary) # add padding
19+
$command = [ordered]@{}
20+
$command.Command = command_name $_
21+
$command.Summary = summary (Get-Content (command_path $command.Command))
22+
$commands += [PSCustomObject]$command
2423
}
2524

26-
$commands.getenumerator() | Sort-Object name | Format-Table -hidetablehead -autosize -wrap
25+
$commands
2726
}
2827

2928
$commands = commands
3029

3130
if(!($cmd)) {
32-
"Usage: scoop <command> [<args>]
31+
Write-Host "Usage: scoop <command> [<args>]
3332
34-
Some useful commands are:"
33+
Available commands are listed below.
34+
35+
Type 'scoop help <command>' to get more help for a specific command."
3536
print_summaries
36-
"Type 'scoop help <command>' to get help for a specific command."
3737
} elseif($commands -contains $cmd) {
3838
print_help $cmd
3939
} else {
40-
"scoop help: no such command '$cmd'"; exit 1
40+
warn "scoop help: no such command '$cmd'"
41+
exit 1
4142
}
4243

4344
exit 0

0 commit comments

Comments
 (0)