Skip to content

Commit 8a30d6d

Browse files
authored
Handle dygraphs missing in a docker image (#292)
1 parent 3ff0f28 commit 8a30d6d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ def timeSeconds(f):
285285
if not docker:
286286
omc.sendExpression('setModelicaPath("%s")' % (librariespath.replace('\\','/') + MSLpath,))
287287
omc_exe=os.path.normpath(os.path.join(omhome,"bin","omc"))
288-
dygraphs=os.path.normpath(os.path.join(ompython_omhome or omhome,"share","doc","omc","testmodels","dygraph-combined.js"))
288+
dygraphs=""
289+
for p in os.path.normpath(os.path.join(ompython_omhome or omhome,"share","doc","omc","testmodels","dygraph-combined.js")):
290+
if os.path.exists(dygraphs): # docker images strip /usr/share/doc from the image...
291+
dygraphs = p
289292
print(omc_exe,omc_version,dygraphs)
290293

291294
sys.stdout.flush()
@@ -1158,7 +1161,7 @@ def cpu_name():
11581161
check_output_log(["rsync", "-aR", "emptydir/", result_location_libname])
11591162
check_output_log(["rsync", "-aR", "emptydir/", result_location_libname+"/files"])
11601163
check_output_log(["rsync", "-aR", "--delete-excluded", "--include-from=%s.files" % libname, "--exclude=*", "./", result_location_libname])
1161-
if (conf.get("referenceFiles") or "") != "":
1164+
if (conf.get("referenceFiles") or "") != "" and dygraphs:
11621165
check_output_log(["rsync", "-a", dygraphs, result_location_libname+"/files"])
11631166
else:
11641167
print("No Sync: result_location [%s] != "" and not isWin [%s] and not noSync [%s] : library: %s" % (result_location, isWin, noSync, libname))

0 commit comments

Comments
 (0)