mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Test that asdf exec
works even if asdf shims are not in PATH.
This commit is contained in:
parent
e51f778b61
commit
6da747b6ce
@ -4,6 +4,8 @@
|
||||
|
||||
Features
|
||||
|
||||
|
||||
* Shims can be invoked directly via `asdf exec <tool> [args...]` without requiring to have all shims on path (#374).
|
||||
* Configurable command hooks from `.asdfrc`
|
||||
Suppose a `foo` plugin is installed and provides a `bar` executable,
|
||||
The following hooks will be executed when set:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# remove this asdf-exec file when v0.7 becomes the stable version
|
||||
echo "asdf is self upgrading shims to new asdf-tool-exec"
|
||||
# remove this asdf-exec file when releasing >=0.6.5
|
||||
echo "asdf is self upgrading shims to new asdf exec ..."
|
||||
|
||||
asdf_dir="$(dirname "$(dirname "$(dirname "$0")")")"
|
||||
# shellcheck source=lib/utils.sh
|
||||
|
@ -30,6 +30,20 @@ teardown() {
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "asdf exec should pass all arguments to executable even if shim is not in PATH" {
|
||||
echo "dummy 1.0" > $PROJECT_DIR/.tool-versions
|
||||
run install_command
|
||||
|
||||
path=$(echo "$PATH" | sed -e "s|$(asdf_data_dir)/shims||g; s|::|:|g")
|
||||
run env PATH=$path which dummy
|
||||
[ "$output" == "" ]
|
||||
[ "$status" -eq 1 ]
|
||||
|
||||
run env PATH=$path $ASDF_DIR/bin/asdf exec dummy world hello
|
||||
[ "$output" == "This is Dummy 1.0! hello world" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "shim exec should pass all arguments to executable" {
|
||||
echo "dummy 1.0" > $PROJECT_DIR/.tool-versions
|
||||
run install_command
|
||||
|
Loading…
Reference in New Issue
Block a user