-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunallscripts.sh
More file actions
47 lines (37 loc) · 1.02 KB
/
Copy pathrunallscripts.sh
File metadata and controls
47 lines (37 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -uo pipefail
# Path to your xojoscript executable
XOSCRIPT="./crossbasic"
# Directory containing .xs scripts
SCRIPT_DIR="Scripts"
# Track whether anything failed
any_failed=0
# Loop over all .xs files in SCRIPT_DIR
for script in "${SCRIPT_DIR}"/*.xs; do
# If no files match, the glob will remain literal—guard against that:
if [[ ! -e "$script" ]]; then
echo "No .xs files found in ${SCRIPT_DIR}."
break
fi
echo "Executing $script"
# Run the script, but do NOT exit this driver script on failure.
# Capture the exit code and continue.
set +e
"$XOSCRIPT" --s "$script"
exit_code=$?
set -e
if [[ $exit_code -ne 0 ]]; then
any_failed=1
echo "❌ Script failed (exit code $exit_code): $script"
else
echo "✅ Script succeeded: $script"
fi
echo
done
if [[ $any_failed -ne 0 ]]; then
echo "Finished: one or more scripts failed."
else
echo "Finished: all scripts succeeded."
fi
# Pause (press any key to continue)
read -n1 -r -p $'\nPress any key to continue...\n'