adding option to remove cache godot

This commit is contained in:
AleaJactaEst 2022-03-28 22:44:23 +02:00
parent 3ee3ab7656
commit 5a310fb4e2

View file

@ -5,6 +5,7 @@ declare HELP=0
declare EDITOR=0 declare EDITOR=0
declare FORCE=0 declare FORCE=0
declare IMPORT=0 declare IMPORT=0
declare ERASEIMPORT=0
declare WORKDIR="$(dirname $(readlink -f $0))" declare WORKDIR="$(dirname $(readlink -f $0))"
declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha5/Godot_v4.0-alpha5_linux.64.zip" declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha5/Godot_v4.0-alpha5_linux.64.zip"
declare OUTZIP="$WORKDIR/$(basename $GODOT_SRC)" declare OUTZIP="$WORKDIR/$(basename $GODOT_SRC)"
@ -95,6 +96,7 @@ do
s) GODOT_SRC=${OPTARG};; s) GODOT_SRC=${OPTARG};;
f) FORCE=1;; f) FORCE=1;;
i) IMPORT=1;; i) IMPORT=1;;
x) ERASEIMPORT=1;;
*) HELP=1;; *) HELP=1;;
esac esac
done done
@ -109,6 +111,7 @@ $(basename $0) [Option] : Donwload Launch Godot
-e : Start Godot in editor mode -e : Start Godot in editor mode
-f : force download & uncompress -f : force download & uncompress
-i : force import data -i : force import data
-x : erase import data
-o <File> : target godot file (downloaded) -o <File> : target godot file (downloaded)
-s <Url> : Url to download a specific godot version -s <Url> : Url to download a specific godot version
EOF EOF
@ -121,6 +124,11 @@ download "$GODOT_SRC" "$OUTZIP"
EXE=$(extract "$OUTZIP") EXE=$(extract "$OUTZIP")
msg_info "Prg:$EXE" msg_info "Prg:$EXE"
if [ $ERASEIMPORT -ne 0 ]
then
rm -f $WORKDIR/.godot/imported/*
fi
if [ $IMPORT -ne 0 ] if [ $IMPORT -ne 0 ]
then then
$WORKDIR/$EXE --editor --quit $WORKDIR/$EXE --editor --quit