Returns :win, :mac, :unix, or nil
| ( defn- os
[ ]
( condp
#( <= 0 ( .indexOf ^ String %2 ^ String %1 ) )
( .toLowerCase ( System/getProperty "os.name" ) )
"win" :win
"mac" :mac
"nix" :unix
"nux" :unix
nil ) )
|
|
Opens the given file (a string, File, or file URI) in the default
application for the current desktop environment. Returns nil
taken from https://github.com/aysylu/loom/blob/master/src/loom/io.clj
| ( defn os-open
[ f ]
( let [ f ( io/file f ) ]
( condp = ( os )
:mac ( sh/sh "open" ( str f ) )
:win ( sh/sh "cmd" ( str "/c start " ( -> f .toURI .toURL str ) ) )
:unix ( sh/sh "xdg-open" ( str f ) ) )
nil ) )
|
|