Skip to content
Snippets Groups Projects
Commit eb8674c5 authored by mimc's avatar mimc
Browse files

Updated the logic on accompanying files

parent c16c62ba
No related branches found
No related tags found
No related merge requests found
Pipeline #9434 failed
......@@ -192,11 +192,11 @@ class Hawc2_Simulation(object):
if not self.accompanying_files is None:
for i, accompanying_file in enumerate(self.accompanying_files):
destination = os.path.join(self.write_directory,self.accompanying_destinations[i])
destination = os.path.abspath(os.path.realpath(destination))
if not os.path.isfile(destination) and not os.path.isdir(destination):
if not os.path.isfile(destination) and not os.path.isdir(destination) and not os.path.islink(destination):
dest_dir = os.path.dirname(destination)
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
destination = os.path.abspath(os.path.realpath(destination))
os.symlink(accompanying_file, destination)
# Get the directory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment