From 443a0bae4e4a41e38363d439ba1bc0af1a29ed93 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 15 Oct 2019 18:22:38 -0400 Subject: [PATCH] use abspath for config --- backupy.py | 6 +++++- setup.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backupy.py b/backupy.py index 76b6518..fa71016 100644 --- a/backupy.py +++ b/backupy.py @@ -276,6 +276,8 @@ def __init__(self, args): def saveJson(self): self.config.save, self.config.load = False, False + self.config.source = os.path.abspath(self.config.source) + self.config.dest = os.path.abspath(self.config.dest) writeJson(os.path.join(self.config.source, self.config.config_dir, "config.json"), vars(self.config)) print("Config saved") sys.exit() @@ -284,7 +286,7 @@ def loadJson(self): current_source = self.config.source config = readJson(os.path.join(self.config.source, self.config.config_dir, "config.json")) self.config = ConfigObject(config) - if current_source != self.config.source: + if os.path.abspath(current_source) != os.path.abspath(self.config.source): print("The specified source does not match the loaded config file, exiting") sys.exit() @@ -546,3 +548,5 @@ def main(): # TODO # 1. Increase test coverage # 2. Release gooey build +# 3. Replace source_root and dest_root with config.source and config.dest and convert to abspath in init +# 4. Use colourString in more print statements diff --git a/setup.py b/setup.py index f6bdd9d..610fe52 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="backupy", - version="0.2.2", + version="0.2.3", description="Simple python script for backing up directories", long_description=long_description, long_description_content_type="text/markdown",