Skip to content

Commit

Permalink
Merge pull request #373 from ScilifelabDataCentre/patch-escape-destio…
Browse files Browse the repository at this point in the history
…nation

Escape the destination
  • Loading branch information
i-oden authored Mar 9, 2022
2 parents a0e7b32 + fd80d2a commit efa0f3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dds_cli/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys

# Installed
import rich.markup

# Own modules

Expand Down Expand Up @@ -45,9 +46,11 @@ def __init__(self, path=pathlib.Path, add_file_dir: bool = True):
except OSError as e:
if e.errno == errno.EEXIST:
sys.exit(
f"Directory '{dir}' already exists. Please specify a path where a new folder can be created."
f"Directory '{rich.markup.escape(str(dir))}' already exists. Please specify a path where a new folder can be created."
)
else:
sys.exit(f"The temporary directory '{dir}' could not be created: {e}")
sys.exit(
f"The temporary directory '{rich.markup.escape(str(dir))}' could not be created: {e}"
)

self.directories = dirs

0 comments on commit efa0f3e

Please sign in to comment.