DFS_COLOR

This commit is contained in:
xiongdian.me 2022-12-05 23:19:44 +08:00
parent f15e0836e3
commit b1c2041f60
5 changed files with 7 additions and 5 deletions

View File

@ -35,7 +35,7 @@ if [[ "$(git rev-parse HEAD)" == "$DFS_COMMIT" ]]; then
fmt_info "nothing to do" fmt_info "nothing to do"
else else
fmt_info "checking out to commit $DFS_COMMIT ..." fmt_info "checking out to commit $DFS_COMMIT ..."
if [[ -z "$DFS_DEV" ]]; then if [[ -z "$DFS_DEV" || "$DFS_DEV" == "0" ]]; then
post_beacon "dfs.updated" post_beacon "dfs.updated"
git -c advice.detachedHead=false checkout $DFS_COMMIT git -c advice.detachedHead=false checkout $DFS_COMMIT
cp ./.update.sh ./update.sh && chmod +x ./update.sh && exit $DFS_UPDATED_RET cp ./.update.sh ./update.sh && chmod +x ./update.sh && exit $DFS_UPDATED_RET

View File

@ -15,7 +15,7 @@ apk_add()
# lite # lite
apk add zsh bash git tmux vim curl fzf iputils coreutils util-linux apk add zsh bash git tmux vim curl fzf iputils coreutils util-linux
# full # full
if [[ -z "$DFS_LITE" ]]; then if [[ -z "$DFS_LITE" || "$DFS_LITE" == "0" ]]; then
apk add wget python3 py3-pip htop gcc g++ cmake make perl linux-headers bind-tools man-db apk add wget python3 py3-pip htop gcc g++ cmake make perl linux-headers bind-tools man-db
fi fi
} }

View File

@ -6,7 +6,7 @@ if [[ -f ~/.config/dotfiles/env ]]; then set -a; source ~/.config/dotfiles/env;
# Color settings # Color settings
# Source: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh # Source: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
if [ -t 1 ]; then if [[ -t 1 || "$DFS_COLOR" == "1" ]]; then
is_tty() { is_tty() {
true true
} }
@ -110,6 +110,8 @@ parse_arg()
if [[ -z "$ARG" ]]; then ARG=$1; shift; fi if [[ -z "$ARG" ]]; then ARG=$1; shift; fi
case $ARG in case $ARG in
-q*|--quite ) export DFS_QUIET=1 ;; -q*|--quite ) export DFS_QUIET=1 ;;
-l*|--lite ) export DFS_LITE=1 ;;
--color ) export DFS_COLOR=1; is_tty() { true }; setup_color ;;
--* ) PARSE_ARG_RET+=("$ARG") ;; --* ) PARSE_ARG_RET+=("$ARG") ;;
-* ) PARSE_ARG_RET+=("${ARG:0:2}") ;; -* ) PARSE_ARG_RET+=("${ARG:0:2}") ;;
* ) PARSE_ARG_RET+=("$ARG") ;; * ) PARSE_ARG_RET+=("$ARG") ;;

View File

@ -17,7 +17,7 @@ pacman_S()
# lite # lite
pacman -S tmux git zsh bash curl vim pacman -S tmux git zsh bash curl vim
# full # full
if [[ -z "$DFS_LITE" ]]; then if [[ -z "$DFS_LITE" || "$DFS_LITE" == "0" ]]; then
pacman -S wget base-devel mingw-w64-x86_64-toolchain make cmake gcc zip unzip python3 python3-pip man-pages-posix pacman -S wget base-devel mingw-w64-x86_64-toolchain make cmake gcc zip unzip python3 python3-pip man-pages-posix
fi fi
} }

View File

@ -16,7 +16,7 @@ apt_install()
# lite # lite
apt-get install -y git zsh bash tmux vim curl inetutils-ping less bsdmainutils apt-get install -y git zsh bash tmux vim curl inetutils-ping less bsdmainutils
# full # full
if [[ -z "$DFS_LITE" ]]; then if [[ -z "$DFS_LITE" || "$DFS_LITE" == "0" ]]; then
apt-get install wget dialog net-tools dnsutils netcat traceroute sudo python3 python3-pip cron openssh-client openssh-server htop gcc g++ cmake make zip apt-get install wget dialog net-tools dnsutils netcat traceroute sudo python3 python3-pip cron openssh-client openssh-server htop gcc g++ cmake make zip
for i in {fzf,ripgrep,man-db}; do apt-get install -y $i; done for i in {fzf,ripgrep,man-db}; do apt-get install -y $i; done
fi fi