Jakski / asdf-janet

Janet plugin for asdf version manager
MIT License
6 stars 0 forks source link

Prevent unbound variable when running with no args #3

Closed kiliantyler closed 3 days ago

kiliantyler commented 1 month ago

When running janet with no args you currently get:

> asdf plugin add janet https://github.com/jakski/asdf-janet.git
> asdf install janet latest
[snip]
> asdf global janet latest
> which janet
<asdf_install_dir>/shims/janet

> janet
<asdf_install_dir>/lib/commands/command-exec.bash: line 23: shim_args[@]: unbound variable

With these changes:

> asdf plugin add janet https://github.com/kiliantyler/asdf-janet.git
> asdf install janet latest
[snip]
> asdf global janet latest
> which janet
<asdf_install_dir>/shims/janet

> janet
Janet 1.35.2-meson macos/aarch64/clang - '(doc)' for help
repl:1:>

Ref: https://github.com/code-lever/asdf-rust/issues/17 code-lever/asdf-rust@17a96bd (#19)

Jakski commented 1 month ago

@kiliantyler Thank you for reporting this. Can you verify that the following solution https://github.com/jthegedus/asdf-gcloud/issues/68#issuecomment-1561070191 works for you? I've browsed a bit and it seems that the issue affects only(?) MacOS. I know that it's using some legacy version of Bash by default. I couldn't reproduce this issue with Bash 5.2.15. I want to keep errexit and pipefail flags, since they are in general useful for intercepting hidden errors.