mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-06 05:00:27 +00:00
Remove sed usage in canonicalize_windows_path
This commit is contained in:
11
main.sh
11
main.sh
@@ -448,7 +448,16 @@ init_install_action_bin_dir() {
|
||||
}
|
||||
canonicalize_windows_path() {
|
||||
case "${host_os}" in
|
||||
windows) sed -E 's/^\/cygdrive\//\//; s/^\/c\//C:\\/; s/\//\\/g' <<<"$1" ;;
|
||||
windows)
|
||||
local t="$1"
|
||||
if [[ "${t}" == '/cygdrive/'* ]]; then
|
||||
t="${t#/cygdrive}"
|
||||
fi
|
||||
if [[ "${t}" == '/c/'* ]]; then
|
||||
t="${t/\/c\//C:\\}"
|
||||
fi
|
||||
printf '%s\n' "${t//\//\\}"
|
||||
;;
|
||||
*) printf '%s\n' "$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user