Skip to content

Commit 6fab401

Browse files
committed
feat(scoop-import): add --update and --reset (#5525)
1 parent 3dfb4bf commit 6fab401

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Features
44

5+
- **scoop-import:** Add support for resetting and updating of apps to be imported ([#5525](https://github.com/ScoopInstaller/Scoop/issues/5525))
56
- **scoop-update:** Add support for parallel syncing buckets in PowerShell 7 and improve output ([#5122](https://github.com/ScoopInstaller/Scoop/issues/5122))
67
- **bucket:** Switch nirsoft bucket to ScoopInstaller/Nirsoft ([#5328](https://github.com/ScoopInstaller/Scoop/issues/5328))
78
- **config:** Support portable config file ([#5369](https://github.com/ScoopInstaller/Scoop/issues/5369))

libexec/scoop-import.ps1

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
# Usage: scoop import <path/url to scoopfile.json>
1+
# Usage: scoop import <path/url to scoopfile.json> [options]
22
# Summary: Imports apps, buckets and configs from a Scoopfile in JSON format
33
# Help: To replicate a Scoop installation from a file stored on Desktop, run
44
# scoop import Desktop\scoopfile.json
5+
#
6+
# Options:
7+
# -r, --reset Reset the app after installation
8+
# -u, --update Update the app after installation
59

6-
param(
7-
[Parameter(Mandatory)]
8-
[String]
9-
$scoopfile
10-
)
11-
10+
. "$PSScriptRoot\..\lib\getopt.ps1"
1211
. "$PSScriptRoot\..\lib\manifest.ps1"
1312

13+
$opt, $scoopfile, $err = getopt $args 'ru:' 'reset', 'update'
14+
if ($err) { "scoop import: $err"; exit 1 }
15+
16+
$update = $opt.u -or $opt.update
17+
$reset = $opt.r -or $opt.reset
1418
$import = $null
1519
$bucket_names = @()
1620
$def_arch = Get-DefaultArchitecture
@@ -59,6 +63,14 @@ foreach ($item in $import.apps) {
5963

6064
& "$PSScriptRoot\scoop-install.ps1" $app @instArgs
6165

66+
if ($update) {
67+
& "$PSScriptRoot\scoop-update.ps1" $app$global
68+
}
69+
70+
if ($reset) {
71+
& "$PSScriptRoot\scoop-reset.ps1" $app
72+
}
73+
6274
if ('Held package' -in $info) {
6375
& "$PSScriptRoot\scoop-hold.ps1" $item.Name @holdArgs
6476
}

0 commit comments

Comments
 (0)