KNOXDEV / scoop-backup

Backup your entire current scoop installation with one command
The Unlicense
60 stars 6 forks source link

scoop detection fails #10

Closed nicerloop closed 2 years ago

nicerloop commented 2 years ago

the first line of the produced restore script does not work as expected:

PS C:\Users\vagrant> try{if(Get-Command scoop){}} catch {iex (new-object net.webclient).downloadstring('https://get.scoop.sh')}
Get-Command : The term 'scoop' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:8
+ try{if(Get-Command scoop){}} catch {iex (new-object net.webclient).do ...
+        ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (scoop:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

tested using https://app.vagrantup.com/gusztavvargadr/boxes/windows-10

proposed alternative is:

if (Get-Command scoop*) {} else {iwr -useb get.scoop.sh | iex}
KNOXDEV commented 2 years ago

I've pushed a fix to https://github.com/KNOXDEV/scoop-backup/commit/dd834644e7bcf1c8958a80e3684fc4a494991c33 and also pushed to the bucket, so a scoop update scoop-backup should pull it.

Let me know if that fixes the issue.

nicerloop commented 2 years ago

Tested and validated. Thank you very much for this utility.