Skip to content

Commit

Permalink
fix(import): Fix scoop import command (#5210)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Oct 23, 2022
1 parent 1c6ab39 commit 01fe9cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- **decompress:** Use PS's default 'Expand-Archive()' ([#5185](https://github.com/ScoopInstaller/Scoop/issues/5185))
- **hash:** Fix SourceForge's hash extraction ([#5189](https://github.com/ScoopInstaller/Scoop/issues/5189))
- **decompress:** Trim ending '/' ([#5195](https://github.com/ScoopInstaller/Scoop/issues/5195))
- **scoop-import:** Add correct architecture argument ([#5210](https://github.com/ScoopInstaller/Scoop/issues/5210))

### Code Refactoring

Expand Down
2 changes: 1 addition & 1 deletion lib/getopt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getopt($argv, $shortopts, $longopts) {
}

# ensure these are arrays
$argv = @($argv)
$argv = @($argv -split ' ')
$longopts = @($longopts)

for ($i = 0; $i -lt $argv.Length; $i++) {
Expand Down
8 changes: 5 additions & 3 deletions libexec/scoop-import.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ foreach ($item in $import.apps) {
} else {
''
}
$arch = if ('64bit' -in $info) {
$arch = if ('64bit' -in $info -and '64bit' -ne $def_arch) {
' --arch 64bit'
} elseif ('32bit' -in $info) {
} elseif ('32bit' -in $info -and '32bit' -ne $def_arch) {
' --arch 32bit'
} else {
} elseif ('arm64' -in $info -and 'arm64' -ne $def_arch) {
' --arch arm64'
} else {
''
}

$app = if ($item.Source -in $bucket_names) {
Expand Down

0 comments on commit 01fe9cc

Please sign in to comment.