-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·39 lines (29 loc) · 992 Bytes
/
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
#!/bin/bash
echo "installing instantOS development tools"
chmod +x ./*.sh
chmod +x utils/*.sh
if command -v termux-info; then
echo "installing on termux"
TARGET="$PREFIX"
sudo() {
eval "$@"
}
else
TARGET="/usr/local"
fi
echo "installing to $TARGET"
sudo cp ibuild.sh $TARGET/bin/ibuild
sudo chmod 755 $TARGET/bin/ibuild
[ -e $TARGET/share/instanttools ] ||
sudo mkdir -p $TARGET/share/instanttools
sudo cp utils/*.sh $TARGET/share/instanttools/
sudo chmod 755 $TARGET/share/instanttools/*
echo 'generating help cache'
rg '^# doc:.*' $TARGET/share/instanttools/* | sed 's/:# doc: /\n /g' | sed 's/^\/.*\///g' | sed 's/.sh$//g' | sudo tee $TARGET/share/instanttools/helpcache.txt
echo 'finished generating help cache
'
if ! command -v i; then
sudo ln -s "$TARGET/bin/ibuild" "$TARGET/bin/i"
fi
git log --format="%H" -n 1 | grep -Eo '^.{10}' | sudo tee /usr/local/share/instanttools/version
echo "finished installing instantOS development tools"