From 7f150aaf7234ec38c456e2d5dfe9b5605812c0b4 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 8 Aug 2021 21:53:50 -0400 Subject: [PATCH] plugins/osx: use `$OSTYPE` instead of `$(uname)` --- plugins/available/osx.plugin.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/available/osx.plugin.bash b/plugins/available/osx.plugin.bash index 2c16820c..ca1f66b8 100644 --- a/plugins/available/osx.plugin.bash +++ b/plugins/available/osx.plugin.bash @@ -2,7 +2,7 @@ cite about-plugin about-plugin 'osx-specific functions' # OS X: Open new tabs in same directory -if [ $(uname) = "Darwin" ]; then +if [[ $OSTYPE == 'darwin'* ]]; then if type update_terminal_cwd > /dev/null 2>&1 ; then if ! [[ $PROMPT_COMMAND =~ (^|;)update_terminal_cwd($|;) ]] ; then PROMPT_COMMAND="${PROMPT_COMMAND%;};update_terminal_cwd" @@ -46,13 +46,13 @@ function dock-switch() { example '$ dock-switch 2d' group 'osx' - if [ $(uname) = "Darwin" ]; then + if [[ "$OSTYPE" = 'darwin'* ]]; then - if [ $1 = 3d ] ; then + if [[ $1 = 3d ]] ; then defaults write com.apple.dock no-glass -boolean NO killall Dock - elif [ $1 = 2d ] ; then + elif [[ $1 = 2d ]] ; then defaults write com.apple.dock no-glass -boolean YES killall Dock @@ -90,7 +90,7 @@ function prevcurl() { param '1: url' group 'osx' - if [ ! $(uname) = "Darwin" ] + if [[ ! $OSTYPE = 'darwin'* ]] then echo "This function only works with Mac OS X" return 1 @@ -103,7 +103,7 @@ function refresh-launchpad() { example '$ refresh-launchpad' group 'osx' - if [ $(uname) = "Darwin" ];then + if [[ "$OSTYPE" = 'darwin'* ]];then defaults write com.apple.dock ResetLaunchPad -bool TRUE killall Dock else