-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdev.bash
executable file
·32 lines (26 loc) · 1.06 KB
/
dev.bash
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
#!/bin/bash
target=gmake2
err=0
sys_command=premake5
shipped_bin=vendor/premake5/binaries/premake5
shipped_bin_fallback=vendor/premake5/binaries/premake5_fallback
premake_success_postcommands='make -j 6 all && ./bin/Debug*/Application/Application'
premake_succes=0
($sys_command $target ||
(
echo "" &&
echo "WARNING: Premake5 is not installed on the system, searching for shipped precompiled binary" &&
echo "" &&
$shipped_bin $target || $shipped_bin_fallback $target
)
) && (premake_succes=1 && echo "> Premake executed with 0 errors" && eval $premake_success_postcommands) ||
(
err=$?;
[[ err > 0 ]] && echo "*** ERRORS HAVE OCCURRED! ***" &&
[[ "$premake_succes" = 1 ]] && echo "But premake5 executed flawlessly" exit $err;
echo "";
[[ "$err" = 127 ]] && echo "ERROR: couldn't find vendor/premake5/binaries/premake5 (it should come with the git repository)"
printf "\nPremake FAILED :( status=%d\n" $err ||
echo "Premake Failed :( status=$err";
exit $err
)