Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(scoop-import): Import a Scoop installation from JSON #5014

Merged
merged 7 commits into from
Jun 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
complete
  • Loading branch information
rashil2000 committed Jun 22, 2022
commit 4686900bd55066b2b379f1aeda2cc25b42fa59d7
12 changes: 5 additions & 7 deletions libexec/scoop-import.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Usage: scoop import <path to scoopfile.json>
# Usage: scoop import <path/url to scoopfile.json>
# Summary: Imports apps, buckets and configs from a Scoopfile in JSON format

param([Parameter(Mandatory)][String]$scoopfile)
@@ -18,12 +18,12 @@ if (Test-Path $scoopfile) {
if (!$import) { abort 'Input file not a valid JSON.' }

$import.config.PSObject.Properties | ForEach-Object {
# set_config $_.Name $_.Value | Out-Null
set_config $_.Name $_.Value | Out-Null
Write-Host "'$($_.Name)' has been set to '$($_.Value)'"
}

$import.buckets | ForEach-Object {
# add_bucket $_.Name $_.Source | Out-Null
add_bucket $_.Name $_.Source | Out-Null
$bucket_names += $_.Name
}

@@ -50,11 +50,9 @@ $import.apps | ForEach-Object {
$_.Source
}

Write-Host $app$global$arch
# & "$PSScriptRoot\scoop-install.ps1" $app$global$arch
& "$PSScriptRoot\scoop-install.ps1" $app$global$arch

if ('Held package' -in $info) {
Write-Host $($_.Name)$global
# & "$PSScriptRoot\scoop-hold.ps1" $($_.Name)$global
& "$PSScriptRoot\scoop-hold.ps1" $($_.Name)$global
}
}