From 7837ba6a993fb2243b3e69fdbd63b437a8674b4c Mon Sep 17 00:00:00 2001 From: Webpage-gh <70434775+Webpage-gh@users.noreply.github.com> Date: Fri, 31 Mar 2023 13:37:01 +0800 Subject: fix(installer): don't use `sudo` when user is in Termux (#11591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- tools/install.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index f4ef16a0c..efdb7d482 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -84,6 +84,11 @@ command_exists() { user_can_sudo() { # Check if sudo is installed command_exists sudo || return 1 + # Termux can't run sudo unless the device is rooted. Either way, `chsh` works + # without sudo, so we can detect it and exit the function early. + case "$PREFIX" in + *com.termux*) return 1 ;; + esac # The following command has 3 parts: # # 1. Run `sudo` with `-v`. Does the following: -- cgit v1.2.3-70-g09d2 From f8bf88edca7a3246e065f13cefac2c5f1ab396e0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 3 Apr 2023 22:21:49 +0200 Subject: chore(installer): remove words triggering false positives in antiviruses --- tools/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index efdb7d482..fcfbcf778 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -84,8 +84,7 @@ command_exists() { user_can_sudo() { # Check if sudo is installed command_exists sudo || return 1 - # Termux can't run sudo unless the device is rooted. Either way, `chsh` works - # without sudo, so we can detect it and exit the function early. + # Termux can't run sudo, so we can detect it and exit the function early. case "$PREFIX" in *com.termux*) return 1 ;; esac -- cgit v1.2.3-70-g09d2