Create .cmd on Cygwin

This commit is contained in:
Sebastian Gniazdowski 2020-06-20 08:30:34 +02:00
parent b874656195
commit 892efc3730
3 changed files with 15 additions and 3 deletions

View file

@ -26,11 +26,11 @@ cd ${dir}"}
"
if (( run_type == 0 )); then
REPLY+="%bindir%\\${bint}"
REPLY+="%bindir%\\${bint} %*"
elif (( run_type == 1 )); then
REPLY+="zsh -c 'source \"%bindir%\"\\\\\\\\${bint}'"
REPLY+="zsh -c 'source \"%bindir%\"\\\\\\\\${bint} %*'"
elif (( run_type == 2 )); then
REPLY+="zsh -c 'eval \"\$(<\"%bindir%\"\\\\\\\\${bint})\"'"
REPLY+="zsh -c '() { eval \"\$(<\"%bindir%\"\\\\\\\\${bint})\" } %*'"
fi
(( use_all_null )) && REPLY+=" 2>NUL >NUL"

View file

@ -8,6 +8,7 @@
0="${${(M)0:#/*}:-$PWD/$0}"
autoload .za-bgn-bin-or-src-function-body \
.za-bgn-bin-or-src-function-body-cygwin \
.za-bgn-mod-function-body \
→za-bgn-atload-handler →za-bgn-atclone-handler \
→za-bgn-atpull-handler →za-bgn-help-handler \

View file

@ -164,6 +164,17 @@ if (( ${+ZINIT_ICE[sbin]} )) {
fnam="${srcdst[2]:-${srcdst[1]:t}}"
local file="$ZPFX/bin/$fnam"
if [[ $OSTYPE == cygwin ]]; then
.za-bgn-bin-or-src-function-body-cygwin 0 \
"$fnam" \
"$target_binary" "$dir" "$set_gem_home" \
"$set_node_path" "$set_cwd" "$use_all_null" \
"$use_err_null" "$use_out_null"
builtin print -r -- "$REPLY" \
>! "$file.cmd"
command chmod +x "$file.cmd"
fi
.za-bgn-bin-or-src-function-body 0 \
"$fnam" \
"$target_binary" "$dir" "$set_gem_home" \