Commit 53ab1042 authored by snuverink_j's avatar snuverink_j
Browse files

fix copy in case directory is empty and lndir does not exist

parent 297d143f
......@@ -71,11 +71,8 @@ class Simulation:
if os.system('lndir ' + fieldmapPath) != 0:
print("lndir failed (possibly doesn't exist on this system), using cp -rs..."),
if os.system('cp -rs ' + fieldmapPath + '/* .') == 0:
print("Success!")
else:
print("Failed also! Exiting.")
sys.exit()
if os.listdir(fieldmapPath):
os.system('cp -rs ' + fieldmapPath + '/* .')
# Link distribution directory if present
if (os.environ.get('DISTRIBUTIONS')):
......@@ -83,11 +80,8 @@ class Simulation:
if os.path.isdir(distributionPath):
if os.system('lndir ' + distributionPath) != 0:
print("lndir failed (possibly doesn't exist on this system), using cp -rs..."),
if os.system('cp -rs ' + distributionPath + '/* .') == 0:
print("Success!")
else:
print("Failed also! Exiting.")
sys.exit()
if os.listdir(distributionPath):
os.system('cp -rs ' + distributionPath + '/* .')
# Read in the file
filedata = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment