reorganize mod

This commit is contained in:
cclecle
2023-09-20 21:33:31 +01:00
parent 941f151d87
commit 496f24dcde
6 changed files with 37 additions and 0 deletions

37
Run.sh Normal file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
OUTPUT_DIR="$2"
function install() {
rsync -a $SCRIPT_DIR/mods/ $OUTPUT_DIR/mods/ --exclude '.git'
echo install ok
}
function show_help() {
echo
echo "Usage: $0 { install } <COD_INSTALL_DIR>"
echo
}
function check_game_dir() {
### Check if a directory does not exist ###
if [ -z $OUTPUT_DIR ]
then
echo "incorrect <COD_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