Skip to content

Commit

Permalink
fix: tar in mac problem
Browse files Browse the repository at this point in the history
  • Loading branch information
zsq1234 committed Aug 30, 2024
1 parent d96a77b commit 197a67c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ else
exit 1
fi

SCRIPT_DIR="$(dirname $(realpath "$0"))"
_current_info=$0
if [ "$0" == "bash" ] || [ "$0" == "sh" ] || [ "$0" == "sudo" ] || ! [ -f "$0" ]; then
_current_info=$(pwd)
fi
SCRIPT_DIR="$(dirname $(realpath "$_current_info"))"

# check curl command
if ! [ -x "$(command -v curl)" ]; then
Expand Down Expand Up @@ -203,9 +207,23 @@ tar_overwrite=""
if [ -f docker-compose/.env ] && [ -f docker-compose/run.sh ]; then
read -r -p "docker-compose directory already exists, do you want to overwrite it? [y/N] " response
if [ "$response" == "y" ] || [ "$response" == "Y" ]; then
tar_overwrite="--overwrite"
case "$osType" in
"darwin")
tar_overwrite="-U"
;;
"linux")
tar_overwrite="--overwrite"
;;
esac
else
tar_overwrite="--skip-old-files"
case "$osType" in
"darwin")
tar_overwrite="-k"
;;
"linux")
tar_overwrite="--skip-old-files"
;;
esac
fi
fi

Expand Down

0 comments on commit 197a67c

Please sign in to comment.