Skip to content

Commit

Permalink
Merge pull request #66 from PMCC-BioinformaticsCore/release-v0.11.8
Browse files Browse the repository at this point in the history
Fix filescheme.py error on conditional output with secondary files
  • Loading branch information
rlupat authored Jul 21, 2021
2 parents 2a9835c + bf0038a commit af3c914
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion janis_assistant/__meta__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "v0.11.7"
__version__ = "v0.11.8"
DOCS_URL = "https://janis.readthedocs.io"
GITHUB_URL = "https://github.com/PMCC-BioinformaticsCore/janis-assistant"
ISSUE_URL = "https://github.com/PMCC-BioinformaticsCore/janis-assistant/issues/new"
17 changes: 14 additions & 3 deletions janis_assistant/management/filescheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ def link_copy_or_fail(source: str, dest: str, force=False):
while len(to_copy) > 0:
s, d = to_copy.pop(0)

# Check if path is Null/None
if not s:
continue

if not d:
continue

if os.path.exists(d) and force:
Logger.debug(f"Destination exists, overwriting '{d}'")
if os.path.isdir(d):
Expand Down Expand Up @@ -216,13 +223,17 @@ def link_copy_or_fail(source: str, dest: str, force=False):
copyfile(s, d)
except Exception as e:
Logger.critical(
f"An unexpected error occurred when link/copying {s} -> {d}: {e}"
f"An unexpected error occurred when link/copying {source} -> {dest}: {e}"
)

@staticmethod
def prepare_path(path):
if path.startswith("file://"):
return path[6:]
# Check if path is Null / None
if path:
# Check if path starts with file://
if path.startswith("file://"):
return path[6:]

return path

@staticmethod
Expand Down

0 comments on commit af3c914

Please sign in to comment.