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 # install ranger
case "$PM" in case "$PM" in
pkg)
pkg install p7zip unrar
pip install ranger-fm
;;
apt) apt)
# atool/p7zip-full for archive previewing/extracting etc # atool/p7zip-full for archive previewing/extracting etc
sudo apt install -y atool p7zip-full unrar libx11-dev libxext-dev 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' Plug 'preservim/nerdtree'
if $VIM_MODE == 'enhanced' if $VIM_MODE == 'enhanced'
if !executable("node") || !executable("yarnpkg") if !executable("node") || !executable("npm")
echo "nodejs/yarnpkg must be installed in order to use coc.nvim" echo "nodejs/npm must be installed in order to use coc.nvim"
else else
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', {'branch': 'release'}
end end

View File

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

View File

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

10
env.sh
View File

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