mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-18 20:00:07 +00:00
Implement cross-platform open function open_command()
For now this supports: - Mac OS X - Linux (presumably works on all versions) - Cygwin (Windows)
This commit is contained in:
parent
3d5b3430fd
commit
2d0bfcf818
1 changed files with 16 additions and 0 deletions
|
@ -15,6 +15,22 @@ function take() {
|
|||
cd $1
|
||||
}
|
||||
|
||||
function open_command() {
|
||||
local open_cmd
|
||||
|
||||
# define the open command
|
||||
case "$OSTYPE" in
|
||||
darwin*) open_cmd="open" ;;
|
||||
cygwin*) open_cmd="cygstart" ;;
|
||||
linux*) open_cmd="xdg-open" ;;
|
||||
*) echo "Platform $OSTYPE not supported"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
nohup $open_cmd "$@" &>/dev/null
|
||||
}
|
||||
|
||||
#
|
||||
# Get the value of an alias.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue