Skip to content

Commit

Permalink
fix: Argcfile.sh on windows (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Jun 10, 2024
1 parent ea226e5 commit a799428
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Argcfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" "$@")"

0 comments on commit a799428

Please sign in to comment.