bash: improve operating system detection
The -s flag to `uname` makes sure that only the string "Darwin" is printed, so the comparison is safer.
This commit is contained in:
parent
e5f4c25593
commit
9c4c579938
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"
|
||||||
# See: https://superuser.com/a/583502
|
# See: https://superuser.com/a/583502
|
||||||
# shellcheck disable=SC2123 # PATH is being intentionally manipulated here.
|
# shellcheck disable=SC2123 # PATH is being intentionally manipulated here.
|
||||||
# shellcheck disable=SC1091 # /etc/profile is provided by macOS.
|
# shellcheck disable=SC1091 # /etc/profile is provided by macOS.
|
||||||
[ "$(uname)" == "Darwin" ] && { PATH=""; source /etc/profile; }
|
[ "$(uname -s)" == "Darwin" ] && { PATH=""; source /etc/profile; }
|
||||||
|
|
||||||
_prepend_path() { # prepend $1 to var $2 avoiding duplicates using : as separator
|
_prepend_path() { # prepend $1 to var $2 avoiding duplicates using : as separator
|
||||||
if [ -d "$1" ] && [ -n "$2" ]; then
|
if [ -d "$1" ] && [ -n "$2" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue