mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-13 01:10:09 +00:00
fix(installer): don't use sudo
when user is in Termux (#11591)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
parent
fcbdc330ff
commit
7837ba6a99
1 changed files with 5 additions and 0 deletions
|
@ -84,6 +84,11 @@ command_exists() {
|
||||||
user_can_sudo() {
|
user_can_sudo() {
|
||||||
# Check if sudo is installed
|
# Check if sudo is installed
|
||||||
command_exists sudo || return 1
|
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:
|
# The following command has 3 parts:
|
||||||
#
|
#
|
||||||
# 1. Run `sudo` with `-v`. Does the following:
|
# 1. Run `sudo` with `-v`. Does the following:
|
||||||
|
|
Loading…
Reference in a new issue