Commit Graph

35 Commits

Author SHA1 Message Date
Trevor Brown
f125741fb5 Update code to use . instead of source 2021-05-21 12:03:06 -04:00
Trevor Brown
8bbefba072
chore: ban echo command (#806) 2020-09-22 08:27:52 +10:00
Trevor Brown
52cbf1165c Add .bash file extensions to files containing code executed by Bash 2020-03-02 12:48:05 -05:00
Victor Hugo Borja
b8dc5f1604 Run shfmt on bash files 2019-11-29 10:15:38 -06:00
Victor Hugo Borja
6da747b6ce Test that asdf exec works even if asdf shims are not in PATH. 2019-01-19 20:09:53 -06:00
Victor Hugo Borja
9b27848d07 New shim metadata to allow many plugins with same executable names
Features

* New shim version meta-data allows shims to not depend on a particular plugin
  nor on its relative executable path (#431)
  Upgrading requires shim re-generation and should happen automatically
  by `asdf-exec`:
    `rm -rf ~/.asdf/shims/` followed by `asdf reshim`
* Added lots of tests for shim execution.
  We now make sure that shim execution obeys plugins hooks like
  `list-bin-paths` and `exec-path`.
* Shim exec is now performed by a new `bin/private/asdf-tool-exec` that might
  be faster for most common use case: (versions on local .tool-versions file)
  but fallbacks to slower `get_preset_version_for` which takes legacy formats
  into account.
* Shim exec recommends which plugins or versions to set when command is
  not found.

Fixed Bugs

* Allow many plugins to provide shims with same executable name (#431)
2019-01-19 13:22:12 -06:00
Trevor Brown
c37307a2cc Create get_custom_executable_path function to hold the custom exec path logic 2019-01-05 10:23:41 -05:00
Andrew Thauer
d94e0223bf Implement plugin hook to customize executable path
This feature allows the plugin to optionally change the executable path
of a shim prior to execution. This is useful when the plugin tool has
commands that may exist in multiple locations (like npm).
2018-04-25 22:18:34 -04:00
Edoardo Tenani
9f58c22e98 use exit code 127 when version is not installed 2018-04-05 23:59:35 +02:00
Edoardo Tenani
23bf434dbf use exit code 126 when version is not set 2018-04-05 23:59:31 +02:00
AJ Foster
eb5e5b780c Refactor "no version set" message to utilities 2018-02-25 18:33:42 -05:00
AJ Foster
c2fb6a3140 Escape backticks in command suggestion 2018-02-25 00:50:46 -05:00
AJ Foster
f15a0c9de3 Suggest action when no version is set 2018-02-25 00:40:26 -05:00
Jonathan Knapp
9a3bd01ee4
Ignore following non-constant source 2017-09-04 10:09:47 -04:00
Jonathan Knapp
808a8d48b7
Fix many shellcheck issues; ignore a few others 2017-09-04 10:09:47 -04:00
Trevor Brown
0f7757a910 Correct if statements in asdf-exec and utils.sh. 2017-03-25 14:50:30 -04:00
Daniel Perez
f5152f255a WIP: support system version 2017-03-17 22:00:37 -04:00
Laurens Duijvesteijn
337b335c4d Check if plugin exists before removing it (#77)
Check if plugin exists before removing it
2016-07-06 08:19:15 +09:00
Daniel Perez
3e31c40020 Make it possible to use fallback versions. 2016-05-04 02:22:48 +09:00
Martin Schürrer
aaa8abfd23 Don't spawn subshells, use exec 2015-10-01 19:31:53 +02:00
Martin Schürrer
78d516d063 Fix path: syntax in .tools-version 2015-08-11 12:33:08 +02:00
Akash Manohar J
af4784e516 Check if version is installed 2015-05-25 11:35:05 +05:30
Akash Manohar J
1d9fe07a11 Adhere to new & stable plugin API 2015-05-22 10:47:44 +05:30
Akash Manohar J
540fb8eabc Use ref 2015-05-22 10:41:48 +05:30
Akash Manohar J
b31b4aef67 Use source and set env vars for exec-env 2015-05-21 14:35:26 +05:30
Akash Manohar J
9f4c1d022f Resolve conflicts and merge 2015-05-21 07:14:24 +05:30
Akash Manohar J
beaefd696f Check if executable exists before trying to execute it 2015-05-21 07:12:38 +05:30
Akash Manohar J
a7d1b31dad Use dot operator instead; Allow exporting env vars 2015-05-20 12:36:06 +05:30
Akash Manohar J
4fa59fe271 Support path:/foo/bar in .tool-versions for custom installs 2015-05-20 12:20:37 +05:30
Akash Manohar J
237a5ab59e Fix #1: Better to stick to a single common shell
Referred a couple other version managers. The advantage is not having to
maintain the scripts for other shells (bash comes by default everywhere
I've seen).
2015-05-19 10:44:10 +05:30
Akash Manohar J
b32748a10c Fix asdf-exec 2015-05-18 00:15:00 +05:30
Akash Manohar J
d687a86ab6 Simplify vocabulary 2015-05-17 23:50:51 +05:30
Akash Manohar J
78c2c9b3fc if [ condition ]; then 2015-05-17 16:17:45 +05:30
Akash Manohar J
ab04ca9f55 Just use a subshell, no other way; Thanks to kurahaupo on #bash IRC for helping out 2015-05-17 16:14:20 +05:30
Akash Manohar J
8a660c88a4 asdf-exec 2015-05-17 14:01:03 +05:30