This commit is contained in:
진재연(Jin Jae-yeon) 2024-12-18 10:38:27 -05:00 committed by GitHub
commit 602a40216d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 1 deletions

View File

@ -78,7 +78,7 @@ write_shim_script() {
local version=$2
local executable_path=$3
if ! is_executable "$executable_path"; then
if ! is_executable "$executable_path" && ! is_executable "$executable_path.exe"; then
return 0
fi
@ -107,6 +107,32 @@ $(sort -u <"$temp_versions_path")
exec $(asdf_dir)/bin/asdf exec "${executable_name}" "\$@" # asdf_allow: ' asdf '
EOF
if [ "$OSTYPE" == "msys" ] || [ "$OSTYPE" == "win32" ]; then
cat <<EOF >"$shim_path.bat"
@ECHO OFF
$(sort -u <"$temp_versions_path" | sed -En "s/# /REM /p")
IF "%1"=="" (
GOTO NO_ARGS
) ELSE (
GOTO ARGS_EXIST
)
:NO_ARGS
bash "$HOME/.asdf/shims/${executable_name}"
GOTO EXIT
:ARGS_EXIST
SET ARGUMENTS=%*
SET ARGUMENTS=%ARGUMENTS:\\=\\\\%
bash "$HOME/.asdf/shims/${executable_name}" %ARGUMENTS%
GOTO EXIT
:EXIT
EOF
fi
rm "$temp_versions_path"
chmod +x "$shim_path"

View File

@ -618,6 +618,9 @@ plugin_executables() {
for bin_path in "${all_bin_paths[@]}"; do
for executable_file in "$bin_path"/*; do
if is_executable "$executable_file"; then
if [[ "$executable_file" == *".exe" ]]; then
executable_file=${executable_file::-4}
fi
printf "%s\n" "$executable_file"
fi
done