fix: Argcfile.sh on windows (#42)

This commit is contained in:
sigoden
2024-06-10 21:26:51 +08:00
committed by GitHub
parent ea226e560a
commit a799428b39
+8 -1
View File
@@ -457,7 +457,12 @@ install() {
_die "error: your aichat version don't support function calling"
fi
if [[ ! -e "$functions_dir" ]]; then
ln -s "$(pwd)" "$functions_dir"
if _is_win; then
current_dir="$(cygpath -w "$(pwd)")"
cmd <<< "mklink /D \"${functions_dir%/}\" \"${current_dir%/}\"" > /dev/null
else
ln -s "$(pwd)" "$functions_dir"
fi
echo "$functions_dir symlinked"
else
echo "$functions_dir already exists"
@@ -598,5 +603,7 @@ _die() {
exit 1
}
if _is_win; then set -o igncr; fi
# See more details at https://github.com/sigoden/argc
eval "$(argc --argc-eval "$0" "$@")"