mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Merge pull request #851 from klaxit/fix/posixly-correct
fix: shims break when POSIXLY_CORRECT=1
This commit is contained in:
commit
bd21c99a0a
@ -663,7 +663,10 @@ preset_versions() {
|
|||||||
|
|
||||||
select_from_preset_version() {
|
select_from_preset_version() {
|
||||||
shim_name=$1
|
shim_name=$1
|
||||||
grep -f <(get_shim_versions "$shim_name") <(preset_versions "$shim_name") | head -n 1 | xargs -IVERSION printf "%s\\n" VERSION
|
shim_versions=$(get_shim_versions "$shim_name")
|
||||||
|
if [ -n "$shim_versions" ]; then
|
||||||
|
preset_versions "$shim_name" | grep -F "$shim_versions" | head -n 1 | xargs -IVERSION printf "%s\\n" VERSION
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
select_version() {
|
select_version() {
|
||||||
|
@ -436,3 +436,15 @@ EOM
|
|||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# From @tejanium in https://github.com/asdf-vm/asdf/issues/581#issuecomment-635337727
|
||||||
|
@test "asdf exec should not crash when POSIXLY_CORRECT=1" {
|
||||||
|
export POSIXLY_CORRECT=1
|
||||||
|
|
||||||
|
echo "dummy 1.0" > $PROJECT_DIR/.tool-versions
|
||||||
|
run asdf install
|
||||||
|
|
||||||
|
run asdf exec dummy world hello
|
||||||
|
echo $output
|
||||||
|
[ "$output" == "This is Dummy 1.0! hello world" ]
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user