Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
2d0bfcf8
Commit
2d0bfcf8
authored
Aug 04, 2015
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement cross-platform open function open_command()
For now this supports: - Mac OS X - Linux (presumably works on all versions) - Cygwin (Windows)
parent
3d5b3430
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
functions.zsh
lib/functions.zsh
+16
-0
No files found.
lib/functions.zsh
View file @
2d0bfcf8
...
@@ -15,6 +15,22 @@ function take() {
...
@@ -15,6 +15,22 @@ function take() {
cd
$1
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.
# Get the value of an alias.
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment