-
Notifications
You must be signed in to change notification settings - Fork 786
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: Allow path:
versions to use ~
#1403
Conversation
a0e048f
to
4904395
Compare
lib/utils.bash
Outdated
util_resolve_user_path "${version_info[1]}" | ||
local full_version="${REPLY}" | ||
|
||
printf "%s\n" "$full_version" |
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.
Why doesn't util_resolve_user_path
print the resolved path directly? If it did we could simplify this to:
printf "%s\n" "$(util_resolve_user_path "${version_info[1]}")"
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.
@hyperupcall based on your latest comment, could this be changed to:
util_resolve_user_path "${version_info[1]}"
printf "%s\n" "${REPLY}"
I'd also prefer the REPLY variable be named something more specific, so as to better indicate it's origin. In this case, what about $util_resolve_user_path_reply
?
util_resolve_user_path "${version_info[1]}"
printf "%s\n" "${util_resolve_user_path_reply}"
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.
I feel very strongly towards REPLY
- I did change it to util_resolve_user_path_reply
though
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.
Not sure about the REPLY
variable. If we do want to use a variable I think it should have a more unique name, for example, util_resolve_user_path_reply
.
@Stratus3D I remember seing your post on ASDF performance measurements, and my takeaway was that performance in ASDF could be better for It obviates the spawning of extraneous subshells, which in my experience solves the death by a thousand paper cuts that Bash performance usually boils down to (if you have different experience, I'd like to hear it!). The only downsides that I've come across is that you have to write the But I do use it over named variables like the one you suggested because it is obvious what the return variable is (no need to check), since as you know Bash doesn't support returning actual values. It also matches the But for whatever reason, you don't like this pattern or it's not applicable as much here, then I can rewrite it to use the more traditional approach - what are your thoughts? |
@hyperupcall that all makes sense, I'm just wondering if |
4904395
to
2069189
Compare
Looks like we encountered a schedule brownout for runners on Ubuntu 18.04. We'll need to address that at some point. @hyperupcall did you see my PR comments above? |
b07fd9b
to
d7b9767
Compare
d7b9767
to
4a80983
Compare
Yup! Fixed the things |
@@ -64,7 +64,7 @@ version_command() { | |||
sed -i.bak -e "s|^$plugin_name .*$|$plugin_name ${resolved_versions[*]}|" "$file" | |||
rm -f "$file".bak | |||
else | |||
# Add a trailing newline at the end of the file if missing and file present |
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.
This change could probably be reverted.
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.
Oops I don't think I intentionally removed that
Summary
Closes: #941
Other Information
The lib/functions/versions.bash change is due to a bug that apparently didn't show up before (from this):