asdf-vm/asdf

bug: Invalid path in `asdf/lib/commands/command-plugin-add.bash` when running `asdf plugin add`

Opened this issue · 1 comments

Describe the Bug

I'm following #577 recommendations to install asdf system wide. After cloning the repository to /opt/asdf, ensuring permissions are right, adding path information in my .bashrc, I'm unable to add a plugin:

/opt/asdf/lib/commands/command-plugin-add.bash: line 3: /opt/asdf/lib/lib/functions/plugins.bash: No such file or directory
/opt/asdf/lib/commands/command-plugin-add.bash: line 5: plugin_add_command: command not found

I'm believe "/lib" shouldn't be present twice in the path.

Apologies if it's my own fault as my Linux knowledge is limited. I exhaustively share my process in the "Steps to reproduce" section

Steps to Reproduce

  1. (optional) Remove previous installation https://asdf-vm.com/manage/core.html#uninstall
  2. (optional) unset environment variables which may conflict with the incoming installation
  3. (optional) Confirm there's no environment variables related to asdf by running [ -z $(printenv | grep ASDF) ]] && echo 'OK'
  4. Clone asdf to /opt/asdf by running sudo git clone https://github.com/asdf-vm/asdf.git /opt/asdf --branch v0.14.1
  5. Create an asdf group and add the asdf manager to it groupadd asdf && usermod -aG asdf <user>
  6. Reload the current session in order to activate the group (in my case I renew the SSH connection). Running groups confirms that my users belongs to the asdf group
  7. Set the directory's ownership: sudo chown -R root:asdf /opt/asdf/
  8. Set the directory's rights: sudo chmod -R 750 /opt/asdf/
  9. Add the lines that set ASDF_DATA_DIR and source asdf.sh in the regular user .bashrc: echo -e "\nexport ASDF_DATA_DIR=/opt/asdf\n. \"/opt/asdf/asdf.sh\"\n. \"/opt/asdf/completions/asdf.bash\"" >> ~/.bashrc
  10. Confirm it with:
tail -n3 ~/.bashrc
export ASDF_DATA_DIR=/opt/asdf
. "/opt/asdf/asdf.sh"
. "/opt/asdf/completions/asdf.bash"
  1. source ~/.bashrc
  2. Add plugin dependencies (In my case Ruby, using https://github.com/rbenv/ruby-build/wiki#suggested-build-environment)
  3. Add the plugin asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git

Expected Behaviour

I expect no output and a 0 exit code

Actual Behaviour

127 exit code with the following output:

/opt/asdf/lib/commands/command-plugin-add.bash: line 3: /opt/asdf/lib/lib/functions/plugins.bash: No such file or directory
/opt/asdf/lib/commands/command-plugin-add.bash: line 5: plugin_add_command: command not found

Environment

/opt/asdf/lib/commands/command-info.bash: line 3: /opt/asdf/lib/lib/functions/plugins.bash: No such file or directory
OS:
Linux debian-s-1vcpu-512mb-10gb-fra1-01 6.1.0-22-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) x86_64 GNU/Linux

SHELL:
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.15(1)-release

/opt/asdf/lib/commands/command-info.bash: line 9: asdf_version: command not found
ASDF VERSION:


ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/opt/asdf
ASDF_DIR=/opt/asdf
ASDF_CONFIG_FILE=/home/kawsay/.asdfrc

/opt/asdf/lib/commands/command-info.bash: line 15: plugin_list_command: command not found
ASDF INSTALLED PLUGINS:

asdf plugins affected (if relevant)

No response

"me too" (kinda)

I'm seeing the same pair of "No such file" & "command not found" errors. I followwe the standard "git" install, installing to the standard $HOME/.asdf path. Environment is on a Synology DiskStation, using the git package installed via SynoCommunity. The bash completion of asdf and its sub-commands do work.

I've even tried setting ASDF_DIR="$HOME/.asdf" in ~/.bashrc, prior to sourcing asdf.sh & completions/asdf.bash. But this changed nothing.