forked from lambda-client/lambda-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupWorkspace.sh
More file actions
executable file
·54 lines (42 loc) · 1.48 KB
/
setupWorkspace.sh
File metadata and controls
executable file
·54 lines (42 loc) · 1.48 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
#!/bin/sh
# Created by l1ving on 17/02/20
#
# Used to setup workspace on unix and fix building
#
# Usage: "./setupWorkspace.sh"
#
# To allow use from outside the lambda directory
cd "$(dirname "$0")"
echo "[$(date +"%H:%M:%S")] Checking if git is installed..."
if [ -z "$(which git)" ]; then
echo "[$(date +"%H:%M:%S")] ERROR: Git is not installed, please make sure you install the CLI version of git, not some desktop wrapper for it" >&2
exit 1
fi
echo "[$(date +"%H:%M:%S")] Git is installed!"
#
echo "[$(date +"%H:%M:%S")] Checking for .git dir..."
if [ ! -d ".git" ]; then
echo "[$(date +"%H:%M:%S")] ERROR: Could not detect git repository, exiting" >&2
exit 1
fi
echo "[$(date +"%H:%M:%S")] Found git repository!"
#
echo "[$(date +"%H:%M:%S")] Downloading git submodules..."
git submodule update --init --recursive || {
echo "[$(date +"%H:%M:%S")] ERROR: Failed to init git submodules"
exit 1
}
echo "[$(date +"%H:%M:%S")] Downloaded git submodules!"
#
echo "[$(date +"%H:%M:%S")] Running gradlew classes without daemon..."
./gradlew --no-daemon classes || {
echo "[$(date +"%H:%M:%S")] ERROR: Running gradlew build failed! Run './gradlew --no-daemon classes' manually"
exit 1
}
#
cat logo_ascii.txt 2>/dev/null
echo "=========================================================================="
echo ""
echo "[$(date +"%H:%M:%S")] Build succeeded! All checks passed, you can build normally now!"
echo ""
echo "=========================================================================="