-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-tur-electron-builder.sh
executable file
·68 lines (56 loc) · 1.49 KB
/
setup-tur-electron-builder.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# setup-tur-electron-builder.sh - script to setup an electron building environment
set -e -u -o pipefail
# Enter the working directory
basedir=$(realpath $(dirname $0))
cd $basedir
# Checkout the master branch of termux/termux-packages
if [ -d "./termux-packages" ] && [ -d "./termux-packages/.git" ]; then
echo "Pulling termux-packages..."
pushd ./termux-packages
git reset --hard origin/master
git pull --rebase
popd
else
rm -rf ./termux-packages
git clone https://github.com/termux/termux-packages.git --depth=1
fi
# Checkout the master branch of termux-user-repository/tur
if [ -d "./tur-repo" ] && [ -d "./tur-repo/.git" ]; then
echo "Pulling termux-packages..."
pushd ./termux-packages
git reset --hard origin/master
git pull --rebase
popd
else
rm -rf ./tur-repo
git clone https://github.com/termux-user-repository/tur.git tur-repo --depth=1
fi
# Push changes
git stash -u
# Delete other files
shopt -s extglob
rm -rf !(termux-packages|tur-repo)
shopt -u extglob
# Reset to current branch
git reset --hard
# Merge files
cp -rn ./termux-packages/* ./
cp -rn ./tur-repo/* ./
# Pop changes
if [ "$(git stash list)" != "" ]; then
git stash pop
fi
# Apply script patches
shopt -s nullglob
_patch=
for _patch in ./common-files/building-system-patches/*.patch; do
echo "Applying patch: $_patch"
patch --silent -p1 < $_patch
done
unset _patch
shopt -u nullglob
# Remove override packages
cat ./common-files/override-packages.txt | xargs rm -rfv --
# Remove files
rm -f build-package.sh.orig