@@ -142,7 +142,8 @@ def _resolve_concore_path():
142142 print (" type must be posix (macos or ubuntu), windows, or docker" )
143143 sys .exit (1 )
144144
145- GRAPHML_FILE = sys .argv [1 ]
145+ ORIGINAL_CWD = os .getcwd ()
146+ GRAPHML_FILE = os .path .abspath (sys .argv [1 ])
146147TRIMMED_LOGS = True
147148CONCOREPATH = _resolve_concore_path ()
148149CPPWIN = os .environ .get ("CONCORE_CPPWIN" , "g++" ) #Windows C++ 6/22/21
@@ -196,21 +197,22 @@ def _resolve_concore_path():
196197 OCTAVEEXE = _tools .get ("OCTAVEEXE" , OCTAVEEXE )
197198 OCTAVEWIN = _tools .get ("OCTAVEWIN" , OCTAVEWIN )
198199
199- prefixedgenode = ""
200- sourcedir = sys .argv [2 ]
201- outdir = sys .argv [3 ]
202-
200+ prefixedgenode = ""
201+ sourcedir = os . path . abspath ( sys .argv [2 ])
202+ outdir = os . path . abspath ( sys .argv [3 ])
203+
203204# Validate outdir argument (allow full paths)
204205safe_name (outdir , "Output directory argument" , allow_path = True )
205206
206207if not os .path .isdir (sourcedir ):
207208 logging .error (f"{ sourcedir } does not exist" )
208209 quit ()
209210
210- if len (sys .argv ) == 4 :
211- prefixedgenode = outdir + "_" #nodes and edges prefixed with outdir_ only in case no type specified 3/24/21
212- concoretype = "docker"
213- else :
211+ if len (sys .argv ) == 4 :
212+ # Use only the output directory name in generated prefixes.
213+ prefixedgenode = os .path .basename (os .path .normpath (outdir )) + "_"
214+ concoretype = "docker"
215+ else :
214216 concoretype = sys .argv [4 ]
215217 if not (concoretype in ["posix" ,"windows" ,"docker" ,"macos" ,"ubuntu" ]):
216218 logging .error (" type must be posix (macos or ubuntu), windows, or docker" )
@@ -227,8 +229,8 @@ def _resolve_concore_path():
227229 logging .error (f"if intended, Remove/Rename { outdir } first" )
228230 quit ()
229231
230- os .mkdir (outdir )
231- os .chdir (outdir )
232+ os .makedirs (outdir )
233+ os .chdir (outdir )
232234if concoretype == "windows" :
233235 fbuild = open ("build.bat" ,"w" )
234236 frun = open ("run.bat" , "w" )
@@ -255,8 +257,8 @@ def cleanup_script_files():
255257 fh .close ()
256258atexit .register (cleanup_script_files )
257259
258- os .mkdir ("src" )
259- os .chdir (".." )
260+ os .mkdir ("src" )
261+ os .chdir (ORIGINAL_CWD )
260262
261263logging .info (f"mkconcore { MKCONCORE_VER } " )
262264logging .info (f"Concore path: { CONCOREPATH } " )
0 commit comments