Skip to content

Commit

Permalink
Path management improvements (inventree#8210)
Browse files Browse the repository at this point in the history
- Improve path resolution for backup and restore commands
- Closes inventree#8207
  • Loading branch information
SchrodingersGat authored Sep 30, 2024
1 parent a71754b commit 73a3e50
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 73a3e50

Please sign in to comment.