-
-
Notifications
You must be signed in to change notification settings - Fork 255
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 Shellcheck violations #443
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,10 @@ function install_packages() | |
run $brew_sudo brew upgrade "$@" || return $? | ||
;; | ||
pacman) | ||
local missing_pkgs=($(pacman -T "$@")) | ||
local missing_pkgs=() | ||
while IFS='' read -r line; do | ||
missing_pkgs+=("$line") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a Arch user so I can't verify this, can you double check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't have Arch installed, either. I'm just maintaining Gentoo ebuild in ::guru overlay, and currently I simply disable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, I forgot I can check using the archlinux docker image. |
||
done < <(pacman -T "$@") | ||
|
||
if (( ${#missing_pkgs[@]} > 0 )); then | ||
run $sudo pacman -S "${missing_pkgs[@]}" || return $? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually need the implicit shell-splitting here.
fetch "$ruby/$file" "$package_manager"
will read thedependencies.txt
file and return theapt: pkg1 pkg2 ...
line that matches the"$package_manager"
, but without theapt:
prefix. It is then implicitly splatted into an Array of individual package names. Reading each line would causeruby_dependencies
to become a singleton Array that contains the whole line (ex:("pkg1 pkg2 pkg3")
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, agree. I just followed (blindly) what Shellcheck WIKI was proposing :D