Skip to content

Commit

Permalink
Add --copy-demo option to GDExtension setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut committed Jan 16, 2024
1 parent aca9784 commit 3b82946
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions gdextension/setup_gdextension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ HIGHLIGHT_COLOR='\033[1;36m' # Light Cyan
NC='\033[0m' # No Color
ERROR_COLOR="\033[0;31m" # Red

usage() { echo "Usage: $0 [--copy-demo]"; }

msg () { echo -e "$@"; }
highlight() { echo -e "${HIGHLIGHT_COLOR}$@${NC}"; }
error () { echo -e "${ERROR_COLOR}$@${NC}" >&2; }
Expand All @@ -44,6 +46,22 @@ trap exit SIGINT

set -e

copy_demo=0

# Parsing arguments
for i in "$@"
do
case "${i}" in
--copy-demo)
copy_demo=1
shift
;;
*)
usage
;;
esac
done

highlight Setup started.

if [ ! -d "${PWD}/godot-cpp/" ]; then
Expand All @@ -62,8 +80,13 @@ else
fi

if [ ! -e "${PWD}/demo" ]; then
ln -s limboai/demo demo
highlight -- Linked demo project.
if [ ${copy_demo} == 1 ]; then
cp -r limboai/demo demo
highlight -- Copied demo.
else
ln -s limboai/demo demo
highlight -- Linked demo project.
fi
else
highlight -- Skipping \"demo\". File already exists!
fi
Expand Down

0 comments on commit 3b82946

Please sign in to comment.