-
Notifications
You must be signed in to change notification settings - Fork 774
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
Auto reshim #409
Comments
Current master supports pre/post command hooks (#434), you could use something like This example will reshim after you execute # in your $HOME/.asdfrc
post_rust_cargo = my_post_cargo_install_hook ${@} #!/usr/bin/env bash
# This is my_post_cargo_install_hook
# when cargo was called with install as first argument, reshim
if [ "install" == "$1" ] ; then
asdf reshim rust
fi |
Hi, I'm new to |
@tutume You are looking for asdf-direnv then. |
Thanks. Gonna have a look. |
Maybe reshim automatically after |
I added this and it seems to work --- a/lib/commands/command-exec.bash
+++ b/lib/commands/command-exec.bash
@@ -25,6 +25,7 @@ shim_exec_command() {
if [ "$pre_status" -ne 0 ]; then
return "$pre_status"
fi
+ { while [[ ! "$(cat /proc/$$/stat | cut -d' ' -f3)" =~ (R|S|I) ]]; do sleep 1; done; asdf_run_hook "post_${plugin_name}_${shim_name}" "${shim_args[@]}"; } &
exec "$executable_path" "${shim_args[@]}"
} # ~/.asdfrc
post_python_pip = ~/.local/bin/post_python_pip ${@} # ~/.local/bin/post_python_pip
asdf reshim python "$(asdf current python | tr -s ' ' | cut -d' ' -f2)" |
Steps to reproduce
Install any binaries with most plugins, including rust, python.
According to code-lever/asdf-rust#14 (comment) , nodejs does a reshim sometimes.
Expected behavior
reshim should occur automatically whenever possible.
Actual behavior
Users are regularly wondering why the binaries they have installed are not available.
One very easy way to detect a reshim is needed is for plugins to expose a list of filenames which when modified indicate a reshim is needed.
Typically, the plugins would provide a list of lock filenames which may appear in the source tree.
A slightly more complicated approach is for plugins to expose a list of directories in the plugin installs area which are where new binaries will appear, and should be auto-reshimmed.
The text was updated successfully, but these errors were encountered: