Skip to content

Commit

Permalink
Merge pull request #63 from xylar/fix-input-output-in-subdirs
Browse files Browse the repository at this point in the history
Fix check for inputs in subdirectories
  • Loading branch information
xylar authored May 23, 2023
2 parents 91dfcbd + 2a4b0eb commit ba022b9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions polaris/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,7 @@ def process_inputs_and_outputs(self):
if len(databases_with_downloads) > 0:
self._fix_permissions(databases_with_downloads)

# convert inputs and outputs to absolute paths
self.inputs = [os.path.abspath(os.path.join(step_dir, filename)) for
filename in inputs]

# inputs are already absolute paths, convert outputs to absolute paths
self.outputs = [os.path.abspath(os.path.join(step_dir, filename)) for
filename in self.outputs]

Expand Down Expand Up @@ -565,18 +562,20 @@ def _process_input(entry, config, base_work_dir, component, step_dir):

if target is not None:
filepath = os.path.join(step_dir, filename)
dirname = os.path.dirname(filepath)
if copy:
shutil.copy(target, filepath)
else:
dirname = os.path.dirname(filepath)
try:
os.makedirs(dirname)
except FileExistsError:
pass
symlink(target, filepath)
input_file = target
input_file = os.path.join(dirname, target)
else:
input_file = filename
input_file = os.path.join(step_dir, filename)

input_file = os.path.abspath(input_file)

return input_file, database_subdirs

Expand Down

0 comments on commit ba022b9

Please sign in to comment.