ScoopInstaller/Scoop

[Feature request] Import command

Closed this issue · 7 comments

I think it would be nice to have a counterpart to scoop export > file, for example scoop import file. I know this can currently be achieved in an alternative way, but still it would be more convenient to have a built-in command.

Currently, I use the script to export apps in a single text file:

function ScoopExport {
    $buckets = @{}
    Get-ChildItem '~\scoop\buckets\' | ForEach-Object {
        $job = Start-Job -WorkingDirectory $_.FullName -ScriptBlock {
            git remote get-url origin
        }
        $remote = Receive-Job $job -Wait -AutoRemoveJob
        $buckets[$_.BaseName] = $remote
    }

    $apps = scoop export | ForEach-Object {
        $_ -match '^(?<app>[^\(]+) \(.*\) \[(?<bucket>.*)\]' | Out-Null
        return "$($Matches.bucket)/$($Matches.app)"
    }

    return @{
        apps = $apps
        buckets = $buckets
    } | ConvertTo-Json
}

It attached the bucket info to apps list:

image

@Cologler this is great! do you have a corresponding import script?

@AlJohri commented on 2020年10月22日 GMT+8 下午12:28:

@Cologler this is great! do you have a corresponding import script?

Try https://github.com/Cologler/ScoopBackup-pwsh

Any updates on this issue?

Not yet, would you like to work on it?

@rashil2000 I will see if i can fit some time in before returning to work monday and let you know. Thanks!

If it helps, there was some work done regarding this, see - #2105