forked from Sagit-chu/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·40 lines (35 loc) · 964 Bytes
/
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
38
39
40
#!/bin/bash
git config --global user.email "[email protected]"
git config --global user.name "TrueCharts-Bot"
## AutoUpdate Website BUilder using Git
updater(){
echo -e "${BWhite}Checking for updates...${Color_Off}"
git remote set-url origin "https://github.com/truecharts/website.git"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git fetch -q
git update-index -q --refresh
if [[ $(git status --branch --porcelain) == *"behind"* ]]; then
echo -e "${IPurple}Websuite Builder requires update${Color_Off}"
git reset --hard -q
git checkout -q "${BRANCH}"
git pull -q
echo "script updated"
if [[ "$CHANGED" == "true" ]]; then
echo "LOOP DETECTED, exiting"
exit 1
else
echo "restarting script after update..."
export CHANGED="true"
. "/data/build.sh" "$@"
exit
fi
else
echo -e "${IGreen}script up-to-date${Color_Off}"
export CHANGED="false"
fi
echo ""
}
export -f updater
updater
yarn install --frozen-lockfile
yarn deploy