Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion share/ruby-install/ruby-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function parse_ruby()
case "$string" in
*-[0-9]*)
ruby="${string%-[0-9]*}"
ruby_version="${string#$ruby-}"
ruby_version="${string#"$ruby"-}"
;;
[0-9]*)
ruby="ruby"
Expand Down
2 changes: 1 addition & 1 deletion share/ruby-install/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function fetch()

while IFS="" read -r line; do
if [[ "$line" == "$key:"* ]]; then
echo "${line##$key:*([[:space:]])}"
echo "${line##"$key":*([[:space:]])}"
Copy link
Owner

@postmodern postmodern Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are quotes really needed within bash variable substitutions?

var1="foo bar"
var2="foo bar baz"
echo "${var2#$var1 }"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, but shellcheck disagrees :D

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, which version of ShellCheck are you using? I'm on 0.7.2, which might be older than your version, which might explain why I'm not seeing those warnings?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mine is 0.8.0 :D

fi
done < "$file"
}
Expand Down