forked from luisdavim/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
android.sh
executable file
·60 lines (48 loc) · 1.39 KB
/
android.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
#!/usr/bin/env bash
if [[ "$OSTYPE" != *"android"* ]]; then
echo 'Doesnt look like you are on Android'
echo ' please try the install.sh script'
exit 1
fi
INSTALLDIR=$(pwd)
installPackages() {
apt update && apt upgrade
cat files/pkgs/pkg.lst | grep -Ev '\s*#' | tr '\n' ' ' | xargs apt install -y
}
installDotFiles() {
if ! [ -x "$(command -v git)" ]; then
echo 'installing git!' >&2
apt install git
fi
mkdir -p ${HOME}/.termux/
cd ${INSTALLDIR}
cp -r files/termux/* ${HOME}/.termux/
cp files/bash/bash_aliases_completion ${PREFIX}/etc/bash_completion.d/
curl -sfLo knife_autocomplete https://raw.githubusercontent.com/wk8/knife-bash-autocomplete/master/knife_autocomplete.sh
mv knife_autocomplete ${PREFIX}/etc/bash_completion.d/
curl -sfLo kitchen-completion https://raw.githubusercontent.com/MarkBorcherding/test-kitchen-bash-completion/master/kitchen-completion.bash
mv kitchen-completion ${PREFIX}/etc/bash_completion.d/
termux-fix-shebang /data/data/com.termux/files/usr/etc/bash_completion.d/*
# grep -lir --exclude-dir=.git '#!' ${HOME}/.bash/ | xargs -n 1 termux-fix-shebang
cd ${INSTALLDIR}
}
osConfigs() {
termux-setup-storage
}
installAll() {
installPackages
installDotFiles
osConfigs
./install.sh gopkgs
}
case "$1" in
"packages" | "pkgs")
installPackages
;;
"dotfiles")
installDotFiles
;;
*)
installAll
;;
esac