Skip to content

Commit

Permalink
Path management improvements
Browse files Browse the repository at this point in the history
- Improve path resolution for backup and restore commands
- Closes #8207
  • Loading branch information
SchrodingersGat committed Sep 29, 2024
1 parent 33499d6 commit 495bb0b
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 495bb0b

Please sign in to comment.