Skip to content

Commit e370a83

Browse files
committed
feat(scoop-import): add --reset (#5525)
1 parent 6cdcc75 commit e370a83

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-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

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
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
58

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

12+
$opt, $scoopfile, $err = getopt $args 'r' 'reset', 'update'
13+
if ($err) { "scoop import: $err"; exit 1 }
14+
15+
$reset = $opt.r -or $opt.reset
1416
$import = $null
1517
$bucket_names = @()
1618
$def_arch = Get-DefaultArchitecture
@@ -59,6 +61,10 @@ foreach ($item in $import.apps) {
5961

6062
& "$PSScriptRoot\scoop-install.ps1" $app @instArgs
6163

64+
if ($reset) {
65+
& "$PSScriptRoot\scoop-reset.ps1" $app
66+
}
67+
6268
if ('Held package' -in $info) {
6369
& "$PSScriptRoot\scoop-hold.ps1" $item.Name @holdArgs
6470
}

0 commit comments

Comments
 (0)