Skip to content

Commit

Permalink
Add: linux and MacOS version of the script
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel22247 committed Jul 16, 2024
1 parent 8331c88 commit 8295c30
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions execute_TestRunner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Define the paths
testRunnerPath=""
gamePath=""
outputBasePath=""
giantsEditorPath=""

# Check if the mod folder path is provided
if [ -z "$1" ]; then
echo "Please provide the path to the mod folder."
exit 1
fi

modFolderPath="$1"

# Create the output folder path
modFolderName=$(basename "$modFolderPath")
outputFolderPath="$outputBasePath/${modFolderName}_Output"

# Check if the output folder already exists, if not, create it
if [ ! -d "$outputFolderPath" ]; then
mkdir -p "$outputFolderPath"
else
# If the output folder exists, append a number to avoid conflicts
counter=1
while [ -d "$outputFolderPath" ]; do
outputFolderPath="$outputBasePath/${modFolderName}_Output_$counter"
counter=$((counter + 1))
done
mkdir -p "$outputFolderPath"
fi

echo "Loading Giants TestRunner located on: $testRunnerPath, with GamePath: $gamePath, and output: $outputFolderPath for mod: $modFolderPath"

# Build the command
command="$testRunnerPath \"$modFolderPath\" -e \"$giantsEditorPath\" -g \"$gamePath\" --outputPath \"$outputFolderPath\""

# Execute the command
eval "$command"

0 comments on commit 8295c30

Please sign in to comment.