2024-09-18 12:48:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Check for two parameters
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "Error: requires two parameters."
|
|
|
|
echo "Usage: SM2GenAll.sh <prefix> <packagename>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Navigate to the appropriate directory
|
|
|
|
cd /home/brianr/clients/SM2/SM2Gen/venv || { echo "Error: Failed to change directory."; exit 1; }
|
|
|
|
source /home/brianr/clients/SM2/SM2Gen/venv/bin/activate
|
|
|
|
|
|
|
|
# Check if the HTML file exists
|
|
|
|
if [ ! -f "html/$2.html" ]; then
|
|
|
|
echo "Warning: html/$2.html does not exist. Skipping the first program."
|
|
|
|
else
|
|
|
|
# Run the first program
|
|
|
|
python3 sm1-html-2-json5.py -f "$2.html"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error: sm1-html-2-json5.py failed."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run the second program
|
2024-09-19 11:00:50 +02:00
|
|
|
python3 sm2gen.py -f json5/"$2.json5" --force --noLang
|
2024-09-18 12:48:41 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error: sm2gen.py failed."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run the copySM2 script
|
|
|
|
copySM2.sh SME11 "$1" "$2"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error: copySM2.sh failed."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "All steps completed successfully."
|