Commit Graph

16 Commits

Author SHA1 Message Date
Edwin Kofler
28b348a041
chore: Fix ShellCheck errors in tests (#1450) 2023-01-23 15:29:18 +11:00
Edwin Kofler
b5e981cf1d
chore: Fix ShellCheck errors in tests (#1449) 2023-01-23 10:36:47 +11:00
Edwin Kofler
d81b81f9de
fix: Remove == inside [ (#1421)
* lint(checkstyle): Miscellaneous tweaks
* lint(checkstyle): Add 'no-double-equals' rule
* lint: Remove double equals from `[`
* chore: Remove final double equals

Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
2023-01-14 08:18:44 -05:00
James Hegedus
21bc411915
ci: add latest OSs to testing matrix, bump BATS, shfmt, shellcheck (#1260)
* ci: add latest OSs to testing matrix
* ci: bump bats & shellcheck & shfmt
* chore: format with latest shfmt
2022-06-24 19:20:27 +10:00
Victor Borja
62c4fdb163
Merge pull request #623 from jonmast/prevent-exec-recursion
Ignore shim directory for executable lookups
2020-02-14 14:26:03 -06:00
Jonathan Mast
069c74f45e
Ignore shim directory for executable lookups
Previously, the shims directory was only excluded for system versions,
which meant that `asdf exec` would fall back to a shim if the install
didn't have the desired binary. If the shims are up to date this isn't a
problem since we check the metadata, but it causes issues if those are
out of sync for whatever reason.

I've checked all the uses of this function and I'm not seeing anywhere
we should need the old behavior.
2019-12-21 15:24:55 -05:00
Victor Hugo Borja
e968fe6142 Subcommand-aware command line interface. 2019-11-27 12:17:17 -06:00
Daniel Perez
c06799cfca Fix legacy version and multi versions handling 2019-03-16 19:45:37 +00:00
Victor Hugo Borja
ab59e5618f Move common functionality to utils.sh
- Make shim-exec, shim-env, and which use the same logic to look for commands
- Make sure shim-exec and which use a plugin exec-path hook as documented
  (the hook takes a relative path to the executable and returns also
   a relative path, possibly modified)
- Fix shellchecks
2019-01-20 14:02:22 -06:00
Victor Hugo Borja
9cac0ac50a Faster exec times. Load commands only when nedded.
When testing, use `run asdf` to actually test the command
as the user would invoke it, so that we might catch possible
errors on `bin/asdf`.
2019-01-20 02:13:20 -06:00
Trevor Brown
8bcf8caba4 Write test for the exec-path functionality in the which command 2019-01-05 10:54:02 -05:00
Daniel Perez
2eae89c432 Fix which for when "system" version is present 2018-11-29 00:31:31 +00:00
Fernando Crespo
46e5f7427f Updated which command.
Should fix #205
2018-10-21 00:47:13 -03:00
Melissa Xie
f79dda865a Include plugin name in error message if plugin doesn't exist
Previously, if we ran a command like `asdf install` and we encountered a
plugin that didn't exist, asdf produces an error saying "No such
plugin". Without knowing which plugin it could be referring too, we'd
have to manually go through each plugin in `.tool-versions` to find the
culprit.

With this commit, we'll now also include the plugin name as part of the
messaging for easier debugging.
2018-04-30 12:49:40 -04:00
AJ Foster
a195da28c2 Promote which version check from subshell to enable error emission 2018-02-25 18:34:39 -05:00
Fernando Crespo
97c0fc44e2 Add tests for which command 2017-03-16 00:57:15 -03:00