Skip to content

Commit

Permalink
feat(scoop-import): add --reset (ScoopInstaller#5525)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxthunder committed Oct 19, 2023
1 parent 7b35e19 commit adce1ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features

- **scoop-import:** Add support for resetting of apps to be imported ([#5525](https://github.com/ScoopInstaller/Scoop/issues/5525))
- **scoop-update:** Add support for parallel syncing buckets in PowerShell 7 and improve output ([#5122](https://github.com/ScoopInstaller/Scoop/issues/5122))
- **bucket:** Switch nirsoft bucket to ScoopInstaller/Nirsoft ([#5328](https://github.com/ScoopInstaller/Scoop/issues/5328))
- **config:** Support portable config file ([#5369](https://github.com/ScoopInstaller/Scoop/issues/5369))
Expand Down
20 changes: 13 additions & 7 deletions libexec/scoop-import.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Usage: scoop import <path/url to scoopfile.json>
# Usage: scoop import <path/url to scoopfile.json> [options]
# Summary: Imports apps, buckets and configs from a Scoopfile in JSON format
# Help: To replicate a Scoop installation from a file stored on Desktop, run
# scoop import Desktop\scoopfile.json
#
# Options:
# -r, --reset Reset the app after installation

param(
[Parameter(Mandatory)]
[String]
$scoopfile
)

. "$PSScriptRoot\..\lib\getopt.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"

$opt, $scoopfile, $err = getopt $args 'r' 'reset'
if ($err) { "scoop import: $err"; exit 1 }

$reset = $opt.r -or $opt.reset
$import = $null
$bucket_names = @()
$def_arch = Get-DefaultArchitecture
Expand Down Expand Up @@ -59,6 +61,10 @@ foreach ($item in $import.apps) {

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

if ($reset) {
& "$PSScriptRoot\scoop-reset.ps1" $app
}

if ('Held package' -in $info) {
& "$PSScriptRoot\scoop-hold.ps1" $item.Name @holdArgs
}
Expand Down

0 comments on commit adce1ed

Please sign in to comment.