-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitRun.sh
executable file
·49 lines (41 loc) · 951 Bytes
/
gitRun.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
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#export DEBUG_ENV="yes"
export pidFile="unit.pid"
echo $$ > $pidFile
trap 'rm -f $pidFile' EXIT
if [ -z $2 ]; then
branch="main"
else
branch="$2"
fi
function fetch() {
if [ -f "force_commit.txt" ]; then
echo "Checking out commit: $(cat "force_commit.txt")"
git checkout "$(cat "force_commit.txt")"
return
fi
prevBranch="$branch"
if [ "$(git show-ref --verify --quiet "refs/heads/$branch")" ]; then
branch="main"
echo "Checking out default branch: $branch"
git checkout "$branch"
fi
echo "Pulling changes from $branch..."
git pull
branch="$prevBranch"
}
(
cd '../japi' || exit;
fetch
)
fetch
exec="gradle"
if [ -z "$(which "$exec")" ]; then
exec="gradlew"
fi
if [ "$branch" != "main" ]; then
debugOptions="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
fi
$exec --no-daemon ":$1:bootRun";
#$exec --no-daemon ":$1:installDist";
#"$1/build/install/$1/bin/$1"