Skip to content

Commit

Permalink
Path management improvements (#8210) (#8212)
Browse files Browse the repository at this point in the history
- Improve path resolution for backup and restore commands
- Closes #8207

(cherry picked from commit 73a3e50)

Co-authored-by: Oliver <[email protected]>
  • Loading branch information
github-actions[bot] and SchrodingersGat authored Sep 30, 2024
1 parent 974c273 commit 83be1b8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ def backup(c, clean=False, path=None):
cmd = '--noinput --compress -v 2'

if path:
# Resolve the provided path
path = Path(path)
if not os.path.isabs(path):
path = localDir().joinpath(path).resolve()

cmd += f' -O {path}'

if clean:
Expand Down Expand Up @@ -442,6 +447,11 @@ def restore(
base_cmd = '--noinput --uncompress -v 2'

if path:
# Resolve the provided path
path = Path(path)
if not os.path.isabs(path):
path = localDir().joinpath(path).resolve()

base_cmd += f' -I {path}'

if ignore_database:
Expand Down

0 comments on commit 83be1b8

Please sign in to comment.