plugin/osx: move `$OSTYPE` check to top of file

pull/2008/head
John D Pell 2021-12-30 12:16:37 -08:00
parent db9027989d
commit caa0d48c60
1 changed files with 7 additions and 10 deletions

View File

@ -1,6 +1,11 @@
# shellcheck shell=bash
about-plugin 'osx-specific functions'
if [[ "${OSTYPE}" != 'darwin'* ]]; then
_log_warning "This plugin only works with Mac OS X."
return 1
fi
# OS X: Open new tabs in same directory
if _is_function update_terminal_cwd; then
safe_append_prompt_command 'update_terminal_cwd'
@ -53,10 +58,6 @@ function prevcurl() {
param '1: url'
group 'osx'
if [[ ! $OSTYPE = 'darwin'* ]]; then
echo "This function only works with Mac OS X"
return 1
fi
curl "$*" | open -fa 'Preview'
}
@ -65,12 +66,8 @@ function refresh-launchpad() {
example '$ refresh-launchpad'
group 'osx'
if [[ "$OSTYPE" = 'darwin'* ]]; then
defaults write com.apple.dock ResetLaunchPad -bool TRUE
killall Dock
else
echo "Sorry, this only works on Mac OS X"
fi
}
function list-jvms() {