-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompileLINUX.sh
More file actions
61 lines (49 loc) · 1.23 KB
/
compileLINUX.sh
File metadata and controls
61 lines (49 loc) · 1.23 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
echo "Compiling game to .phlox format..."
if [ ! -f "./lettuce" ]; then
echo "Error: lettuce executable not found in current directory!"
ls
read -p "Press enter to continue..."
exit 1
fi
if [ ! -f "GameInfo.json" ]; then
echo "Error: GameInfo.json not found!"
ls
read -p "Press enter to continue..."
exit 1
fi
mkdir -p build
if [ ! -f source/*.phs ]; then
echo "Error: No .phs files found in source directory!"
ls source
read -p "Press enter to continue..."
exit 1
fi
if [ ! -d "assets" ]; then
echo "Warning: No assets directory found!"
mkdir -p assets
fi
command="./lettuce GameInfo.json"
for f in source/*.phs; do
command="$command \"$f\""
done
command="$command -o build/Data.phlox"
echo "Executing: $command"
eval $command
if [ $? -ne 0 ]; then
echo "Compilation failed!"
read -p "Press enter to continue..."
exit 1
fi
if [ ! -f "build/Data.phlox" ]; then
echo "Error: build/Data.phlox was not created!"
read -p "Press enter to continue..."
exit 1
fi
if [ ! -s "build/Data.phlox" ]; then
echo "Error: build/Data.phlox is empty!"
read -p "Press enter to continue..."
exit 1
fi
echo "Build successful!"
read -p "Press enter to continue..."