From 27bfcacc07ac55471be9a7e47259dea054900a71 Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Fri, 6 Jan 2023 02:07:21 +0800 Subject: [PATCH] introduce SUDOE and so debug --- install.sh | 4 ++-- tools/common.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index d9ef3d5..3cbdbf1 100755 --- a/install.sh +++ b/install.sh @@ -32,10 +32,10 @@ install_dependencies() fmt_note "installing dependencies ..." case $(get_os_name) in "ubuntu"|"debian" ) - $SUDO "$DOTFILES/tools/ubuntu.sh" apt-install + $SUDOE "$DOTFILES/tools/ubuntu.sh" apt-install ;; "alpine" ) - $SUDO "$DOTFILES/tools/alpine.sh" apk-add + $SUDOE "$DOTFILES/tools/alpine.sh" apk-add ;; "macos" ) "$DOTFILES/tools/macos.sh" brew-install diff --git a/tools/common.sh b/tools/common.sh index f0a85ba..1957b3b 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -126,8 +126,10 @@ setup_color() { # END of color settings SUDO='' +SUDOE='' if [[ "$EUID" != "0" && -x $(command -v sudo) ]]; then SUDO='sudo' + SUDOE='sudo -E' fi ask_for_yN()