mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Check for custom shim templates in $plugin/shims
This commit is contained in:
parent
1bfabd67fb
commit
681daec95a
@ -41,11 +41,17 @@ ensure_shims_dir() {
|
||||
write_shim_script() {
|
||||
local plugin_name=$1
|
||||
local executable_path=$2
|
||||
local shim_path=$(asdf_dir)/shims/$(basename $executable_path)
|
||||
local executable_name=$(basename $executable_path)
|
||||
local plugin_shims_path=$(get_plugin_path $plugin_name)/shims
|
||||
local shim_path=$(asdf_dir)/shims/$executable_name
|
||||
|
||||
echo """#!/usr/bin/env bash
|
||||
if [ -f $plugin_shims_path/$executable_name ]; then
|
||||
cp $plugin_shims_path/$executable_name $shim_path
|
||||
else
|
||||
echo """#!/usr/bin/env bash
|
||||
$(asdf_dir)/bin/private/asdf-exec ${plugin_name} ${executable_path} \"\$@\"
|
||||
""" > $shim_path
|
||||
fi
|
||||
|
||||
chmod +x $shim_path
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user