File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11import os
2+ import platform
23from subprocess import check_output
4+ from pathlib import Path
35
46from omv .engines .utils .wdir import working_dir
57
8+
69def install_jnml ():
710
811 version = 'v0.12.2'
912
10- jnmlpath = os .path .join (os .environ ['HOME' ],'jnml' )
13+ try :
14+ jnmlhome = os .environ ['JNML_HOME' ]
15+ jnmlpath = Path (jnmlhome ).parent
16+ except KeyError :
17+ osname = platform .system ()
18+ if osname == "Linux" :
19+ try :
20+ jnmlpath = os .path .join (os .environ ['XDG_DATA_HOME' ],'jnml' )
21+ except KeyError :
22+ jnmlpath = os .path .join (os .environ ['HOME' ],'.local/share/jnml' )
23+ elif osname == "Darwin" :
24+ jnmlpath = os .path .join (os .environ ['HOME' ],'Library/jnml' )
25+ else :
26+ jnmlpath = os .path .join (os .environ ['HOME' ],'jnml' )
27+
1128 if not os .path .isdir (jnmlpath ):
1229 os .mkdir (jnmlpath )
1330 with working_dir (jnmlpath ):
You can’t perform that action at this time.
0 commit comments