-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (51 loc) · 1.33 KB
/
install.sh
File metadata and controls
executable file
·62 lines (51 loc) · 1.33 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
55
56
57
58
59
60
61
62
#!/bin/bash
echo ""
echo "--------------------"
echo "protop dev installer"
echo "--------------------
"
protop_say()
{
echo "[protop] $1"
}
#build a clean distribution
gradle=./gradlew
protop_say "\`gradle clean\`"
$gradle clean -q
protop_say "\`gradle build\`"
$gradle build -Pdev -q
# move distribution
dir=~/.protop
tmp=$dir/tmp
protop_say "Moving build artifacts to temporary directory"
mkdir -p $tmp
rm -rf $tmp/*
dist=$tmp/dist.tgz
cp ./build/distributions/*.tgz $dist
cd $tmp
# unpack
protop_say "Unpacking artifacts"
tar -C . -zxf $dist
protop_say "Deleting previous installation"
rm -rf $dir/dev
mkdir $dir/dev
mkdir $dir/dev/bin
mkdir $dir/dev/lib
protop_say "Moving binaries to their new home"
mv $tmp/*/bin/* $dir/dev/bin/
mv $dir/dev/bin/protop $dir/dev/bin/protop-dev
mv $dir/dev/bin/protop.bat $dir/dev/bin/protop-dev.bat
# and jars
mv $tmp/*/lib/* $dir/dev/lib/
# cleanup
cd $dir && rm -rf $tmp
if [[ ":$PATH:" == *":$HOME/.protop/dev/bin:"* ]]; then
protop_say "\`~/.protop/dev/bin\` already in PATH"
protop_say "Succeeded!
"
protop
else
protop_say "Your path is missing \`~/.protop/dev/bin\`; you will need to add it:"
protop_say " - Add \`export PATH=\"\$PATH:\$HOME/.protop/dev/bin\"\` to your \`~/.bashrc\` or \`~/.zshrc\` etc."
protop_say " - Then try \`protop\` or \`protop help\` to get started!"
fi