add installer

This commit is contained in:
cclecle
2022-11-23 19:40:59 +00:00
parent 34219d5092
commit 69831aec04

45
Run.sh Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
OUTPUT_DIR="$2"
function install() {
rsync -a $SCRIPT_DIR/Animations/ $OUTPUT_DIR/Animations/ --exclude '.git'
rsync -a $SCRIPT_DIR/Help/ $OUTPUT_DIR/Help/ --exclude '.git'
rsync -a $SCRIPT_DIR/Maps/ $OUTPUT_DIR/Maps/ --exclude '.git'
rsync -a $SCRIPT_DIR/Music/ $OUTPUT_DIR/Music/ --exclude '.git'
rsync -a $SCRIPT_DIR/Sounds/ $OUTPUT_DIR/Sounds/ --exclude '.git'
rsync -a $SCRIPT_DIR/StaticMeshes/ $OUTPUT_DIR/StaticMeshes/ --exclude '.git'
rsync -a $SCRIPT_DIR/System/ $OUTPUT_DIR/System/ --exclude '.git'
rsync -a $SCRIPT_DIR/Textures/ $OUTPUT_DIR/Textures/ --exclude '.git'
echo install ok
}
function show_help() {
echo
echo "Usage: $0 { install } <UT2k4_INSTALL_DIR>"
echo
}
function check_game_dir() {
### Check if a directory does not exist ###
if [ -z $OUTPUT_DIR ]
then
echo "incorrect <UT2k4_INSTALL_DIR>"
show_help
exit 9999 # die with error code 9999
fi
}
case "$1" in
'install')
check_game_dir
install
;;
*)
show_help
exit 1
;;
esac
exit 0