-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Improving go helper #2023
base: dev
Are you sure you want to change the base?
Improving go helper #2023
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
helpers/helpers.v1.d/go
Outdated
@@ -90,7 +80,7 @@ ynh_use_go() { | |||
ynh_go_load_path="PATH=$PATH" | |||
|
|||
# Sets the local application-specific Go version | |||
pushd $install_dir | |||
pushd ${install_dir:-$install_dir} |
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.
What's the meaning of this substitution ?
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.
Bad copy paste from:
yunohost/helpers/helpers.v1.d/ruby
Line 95 in a96cb9b
pushd ${install_dir:-$final_path} |
ynh_print_info --message="Downloading goenv..." | ||
git init -q | ||
git remote add origin https://github.com/syndbg/goenv.git | ||
goenv="$(command -v goenv $goenv_install_dir/bin/goenv | grep "$goenv_install_dir/bin/goenv" | head -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.
This command will fail if goenv is not present. You should something like that instead:
if command -v …
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.
In that case
yunohost/helpers/helpers.v1.d/ruby
Line 135 in a96cb9b
rbenv="$(command -v rbenv $rbenv_install_dir/bin/rbenv | grep "$rbenv_install_dir/bin/rbenv" | head -1)" |
and
yunohost/helpers/helpers.v2.1.d/ruby
Line 77 in a96cb9b
rbenv="$(command -v rbenv $RBENV_INSTALL_DIR/bin/rbenv | grep "$RBENV_INSTALL_DIR/bin/rbenv" | head -1)" |
should not be ok
The problem
There was some issues and missing parts in the go helper
Solution
Use the Ruby helper as starting point to improve the go helper
PR Status
Ready
How to test
Put it in package like lxd and use it / I can do some test PR to show that it works