From 2f02bd6dc1ae0a018f43432d41d1fb9a122c26cd Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Wed, 9 Nov 2022 14:54:34 +0800 Subject: [PATCH] install.sh: -l=DFS_LITE --- install.sh | 14 +++++++++----- tools/common.sh | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 2908945..087d7d1 100755 --- a/install.sh +++ b/install.sh @@ -191,9 +191,12 @@ install_tmux_tpm(){ fmt_note "installing tmux tpm ..." git clone https://gitee.com/dictxiong/tpm "$TMUX_TPM" if [[ -x $(command -v g++) && -x $(command -v cmake) && -x $(command -v make) ]]; then - fmt_note "initializing tmux plugins ..." - if [[ -z "$DFS_NO_COMPILE" ]]; then + if [[ -z "$DFS_LITE" || "$DFS_LITE" == "0" ]]; then + fmt_note "initializing tmux plugins ..." ~/.tmux/plugins/tpm/bin/install_plugins + else + fmt_warning "in lite mode, tmux plugins are downloaded but not complied" + fmt_info "try or ~/.tmux/plugins/tpm/bin/install_plugins to complie manually" fi else fmt_warning "pls install g++,cmake,make and then init tmux plugins by or ~/.tmux/plugins/tpm/bin/install_plugins" @@ -254,10 +257,11 @@ while [[ $# > 0 ]]; do case $1 in -i ) BIN=install ;; -r ) BIN=uninstall ;; - -q ) export DFS_QUIET=1 ;; - -d ) export DFS_DEV=1 ;; + -q|--quite ) export DFS_QUIET=1 ;; + -d|--dev ) export DFS_DEV=1 ;; + -l|--lite ) export DFS_LITE=1 ;; -a|--auto ) install_dependencies ;; - * ) fmt_warning "unknown command \"$1\". available: -i, -r, -q, -d"; exit 1 ;; + * ) fmt_warning "unknown command \"$1\". available: -i, -r, -q, -d, -l, -a"; exit 1 ;; esac shift done diff --git a/tools/common.sh b/tools/common.sh index 4dd3c85..1019dcf 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -103,7 +103,7 @@ setup_color() { ask_for_yN() { - while [[ -z "$DFS_QUIET" ]]; do + while [[ -z "$DFS_QUIET" || "$DFS_QUIET" == "0" ]]; do read -p "${FMT_YELLOW}$1${FMT_RESET} [yN]: " yn case $yn in [Yy]* ) return 1;; @@ -115,7 +115,7 @@ ask_for_yN() ask_for_Yn() { - while [[ -z "$DFS_QUIET" ]]; do + while [[ -z "$DFS_QUIET" || "$DFS_QUIET" == "0" ]]; do read -p "${FMT_YELLOW}$1${FMT_RESET} [Yn]: " yn case $yn in [Nn]* ) return 0;;