From c4900be511046628bdd9924f1887e8b43f15ab89 Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Sun, 12 May 2019 15:49:08 -0400 Subject: [PATCH] Fix db_path and test Earlier commit broke the db_path and tests..... --- bumper/__init__.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bumper/__init__.py b/bumper/__init__.py index 9abbbce..618f1ab 100644 --- a/bumper/__init__.py +++ b/bumper/__init__.py @@ -77,15 +77,12 @@ def db_file(): def os_db_path(): - db_path = "" - if platform.system() == "Windows": - - db_path = os.path.join(os.getenv("APPDATA")) + if platform.system() == "Windows": + os.makedirs(os.getenv("APPDATA"), exist_ok=True) #Ensure db_path directory exists or create + return os.path.join(os.getenv("APPDATA"), "bumper.db") else: - db_path = os.path.expanduser("~/.config") - - os.makedirs(db_path, exist_ok=True) #Ensure db_path directory exists or create - return os.path.join(db_path, "bumper.db") + os.makedirs(os.path.expanduser("~/.config"), exist_ok=True) #Ensure db_path directory exists or create + return os.path.expanduser("~/.config/bumper.db") def db_get(): try: