feat: support termux

This commit is contained in:
Klesh Wong 2021-09-16 22:18:49 +08:00
parent 94c5e66105
commit 711b908f4a
5 changed files with 23 additions and 5 deletions

View File

@ -16,6 +16,10 @@ fi
# install ranger
case "$PM" in
pkg)
pkg install p7zip unrar
pip install ranger-fm
;;
apt)
# atool/p7zip-full for archive previewing/extracting etc
sudo apt install -y atool p7zip-full unrar libx11-dev libxext-dev

View File

@ -153,8 +153,8 @@ Plug 'junegunn/fzf.vim'
Plug 'preservim/nerdtree'
if $VIM_MODE == 'enhanced'
if !executable("node") || !executable("yarnpkg")
echo "nodejs/yarnpkg must be installed in order to use coc.nvim"
if !executable("node") || !executable("npm")
echo "nodejs/npm must be installed in order to use coc.nvim"
else
Plug 'neoclide/coc.nvim', {'branch': 'release'}
end

View File

@ -5,7 +5,11 @@ DIR=$(dirname "$(readlink -f "$0")")
log "Setting up go"
# install go
case "$PM" in
pkg)
pkg install golang -y
;;
apt)
sudo apt install -y \
golang

View File

@ -17,6 +17,9 @@ fi
# install python3
case "$PM" in
pkg)
pkg install python
pip install virtualfish
apt)
#for older ubuntu distro
#sudo add-apt-repository ppa:deadsnakes/ppa
@ -25,15 +28,16 @@ case "$PM" in
#sudo apt install python3.8-distutils
#sudo python3.8 -m pip install --upgrade pip setuptools wheel
sudo apt install -y python3 python3-pip python-is-python3
sudo pip install virtualfish
;;
pacman)
sudo pacman -S --noconfirm --needed python python-pip
sudo pip install virtualfish
;;
esac
# enable auto_activation plugin for virtualfish
if has_fish; then
sudo pip install virtualfish
fish -c "yes | vf install && vf addplugins auto_activation"
fi

10
env.sh
View File

@ -9,10 +9,11 @@ PREFIX=/usr/local
PDIR=$(dirname "${DIR-$0}")
GITHUB_PROXY=${GITHUB_PROXY-$HTTPS_PROXY}
WSL=$(grep -i Microsoft /proc/sys/kernel/osrelease || true)
TMPDIR=${TMPDIR-"/tmp"}
in_china() {
! [ -f /tmp/myip_full ] && curl -s myip.ipip.net > /tmp/myip_full
grep -qF '中国' /tmp/myip_full
! [ -f $TMPDIR/myip_full ] && curl -s myip.ipip.net > $TMPDIR/myip_full
grep -qF '中国' $TMPDIR/myip_full
}
lnsf() {
@ -108,6 +109,11 @@ has_cmd sudo && sudo mkdir -p $PREFIX
if has_cmd pacman; then
PM=pacman
elif has_cmd pkg; then
PM=pkg
sudo () {
"$@"
}
elif has_cmd apt; then
PM=apt
fi