-
Notifications
You must be signed in to change notification settings - Fork 10
/
install.sh
executable file
·77 lines (56 loc) · 1.59 KB
/
install.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
69
70
71
72
73
74
75
76
77
#!/bin/bash
#############################################
## install instantASSIST from a local copy ##
#############################################
pushd .
die() {
echo "exiting: $1"
exit 1
}
if [ -z "${ASSISTPREFIX}" ]; then
whoami | grep -q '^root$' || die "not running as root"
fi
rm -rf /tmp/assistinstall
mkdir /tmp/assistinstall
{
[ -e assists ] && [ -e instantassist.desktop ]
} || die "not running from repo"
cp -r ./* /tmp/assistinstall
cd /tmp/assistinstall || die "failed to create tmp file"
git pull
[ -e "${ASSISTPREFIX}"/usr/bin ] || mkdir -p "${ASSISTPREFIX}"/usr/bin
[ -e "${ASSISTPREFIX}"/usr/share/instantassist ] || mkdir -p "${ASSISTPREFIX}"/usr/share/instantassist
# remove old version
if [ -e "${ASSISTPREFIX}"/usr/share/instantassist ]; then
rm -rf "${ASSISTPREFIX}"/usr/share/instantassist
fi
mkdir -p "${ASSISTPREFIX}"/usr/share/instantassist
mkdir -p "${ASSISTPREFIX}"/usr/bin
./cache.sh
chmod -R 755 cache
echo "installing instantassist binary"
chmod 755 instantassist
chmod 755 instantrepeat
cp instantassist "${ASSISTPREFIX}"/usr/bin/instantassist
cp instantrepeat "${ASSISTPREFIX}"/usr/bin/instantrepeat
echo "pwd"
pwd
echo "ls"
ls
rm -rf ./.git
rm install.sh
rm ./*.md
chmod 755 ./assists/*/*.sh
chmod 755 ./assists/*.sh
chmod 755 ./utils/*.sh
installdir() {
echo "installing dir $1"
mkdir -p "${ASSISTPREFIX}"/usr/share/instantassist/"$1"
cp -r "$1"/* "${ASSISTPREFIX}"/usr/share/instantassist/"$1"/
}
installdir cache
installdir assists
installdir data
installdir utils
[ -z "${ASSISTPREFIX}" ] && rm -rf /tmp/assistinstall
popd || exit 1