Skip to content
Snippets Groups Projects
Verified Commit 2790179f authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#107] Tweaked script to run projects with hud, build options and argument forwarding

parent e1e08f2f
No related branches found
No related tags found
1 merge request!99Resolve "Automatische Generierung von cmake-Files für Projekte"
Pipeline #27322 passed
...@@ -8,8 +8,24 @@ if [ $# -lt 1 ]; then ...@@ -8,8 +8,24 @@ if [ $# -lt 1 ]; then
exit exit
fi fi
PROJECT=$1 RUN_WITH_HUD="no"
BUILD_FLAGS=""
while [ $# -gt 1 ]; do
case "$1" in
"--"*)
if [ "$1" = "--hud" ]; then
RUN_WITH_HUD="yes"
else
BUILD_FLAGS="$BUILD_FLAGS$1 "
fi
shift 1;;
*) break;;
esac
done
PROJECT="$1"
PROJECT_DIR="../projects/$PROJECT" PROJECT_DIR="../projects/$PROJECT"
shift 1
# Check if the project name is valid # Check if the project name is valid
if [ ! -d "$PROJECT_DIR" ]; then if [ ! -d "$PROJECT_DIR" ]; then
...@@ -17,7 +33,7 @@ if [ ! -d "$PROJECT_DIR" ]; then ...@@ -17,7 +33,7 @@ if [ ! -d "$PROJECT_DIR" ]; then
exit exit
fi fi
./build.sh $PROJECT ./build.sh $FLAGS "$PROJECT"
cd "$PROJECT_DIR" || exit cd "$PROJECT_DIR" || exit
if [ ! -f "$PROJECT" ]; then if [ ! -f "$PROJECT" ]; then
...@@ -25,4 +41,8 @@ if [ ! -f "$PROJECT" ]; then ...@@ -25,4 +41,8 @@ if [ ! -f "$PROJECT" ]; then
exit exit
fi fi
./$PROJECT if [ "$RUN_WITH_HUD" = "yes" ]; then
\ No newline at end of file MANGOHUD=1 ./"$PROJECT" "$@"
else
./"$PROJECT" "$@"
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment