Skip to content

Commit

Permalink
Validate filepaths in workspace create
Browse files Browse the repository at this point in the history
  • Loading branch information
rfbgo committed Jan 16, 2024
1 parent e950936 commit 1b28d83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ramble/ramble/cmd/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ def _workspace_create(name_or_path, dir=False,
create the workspace with
"""

# Sanity check file paths, to avoid half-creating an incomplete workspace
for filepath in [config, template_execute]:
if filepath and not os.path.isfile(filepath):
logger.die(f"{filepath} file path invalid")

if dir:
workspace = ramble.workspace.Workspace(name_or_path)
workspace.write()
Expand Down

0 comments on commit 1b28d83

Please sign in to comment.