-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·37 lines (33 loc) · 1.2 KB
/
build.sh
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
#!/bin/sh
sdk_name=renpy-$1-sdk
echo "Downloading the specified SDK (${sdk_name})..."
wget -q https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2
clear
echo "Downloaded SDK version (${sdk_name})."
echo "Setting up the specified SDK (${sdk_name})..."
tar -xf ./${sdk_name}.tar.bz2
rm ./${sdk_name}.tar.bz2
mv ./${sdk_name} ../renpy
# Note: This will be checked regardless of the version of Ren'Py. Caution is
# advised.
if [ -d "$2/old-game" ]; then
echo "old-game directory detected."
if [ -z "$(ls -A "$2/old-game")" ]; then
echo "ERROR: old-game is empty. This will cause incompatibility issues."
echo "For more information on how the old-game directory works and why"
echo "this directory should not be empty, please refer to the documentation"
echo "at: https://www.renpy.org/doc/html/build.html#old-game."
exit 1
fi
fi
echo "Building the project at $2..."
if ../renpy/renpy.sh ../renpy/launcher distribute $2; then
built_dir=$(ls | grep '\-dists')
chmod -R 777 $built_dir
chmod -R 777 "$2/game/cache"
chmod -R 777 "$2/game/saves"
echo ::set-output name=dir::$built_dir
echo ::set-output name=version::${built_dir%'-dists'}
else
return 1
fi