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

fix(import): Fix scoop import command #5210

Merged
merged 3 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
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