From 83be1b8a0fc3061709b452110850aee0a9db88eb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:34:38 +1000 Subject: [PATCH] Path management improvements (#8210) (#8212) - Improve path resolution for backup and restore commands - Closes https://github.com/inventree/InvenTree/issues/8207 (cherry picked from commit 73a3e504a9821366a86f8c0cd521a94f283230bf) Co-authored-by: Oliver --- tasks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks.py b/tasks.py index 57c2ceed30..35757b3e31 100644 --- a/tasks.py +++ b/tasks.py @@ -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: @@ -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: