From b66f310e7fe6e14cf1772cbf015516f8cefb5710 Mon Sep 17 00:00:00 2001 From: Christian Busch Date: Mon, 29 Aug 2022 14:27:57 +0200 Subject: [PATCH] fix: read deckfile "." location fixed --- getdeck/utils.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/getdeck/utils.py b/getdeck/utils.py index ca189f5..52b95f6 100644 --- a/getdeck/utils.py +++ b/getdeck/utils.py @@ -42,9 +42,17 @@ def read_deckfile_from_location( logger.info(f"Reading Deckfile from: {location}") if location == ".": # load default file from this location - return config.deckfile_selector.get( - os.path.join(os.getcwd(), configuration.DECKFILE_FILE) - ) + deckfile_location = os.path.join(os.getcwd(), configuration.DECKFILE_FILE) + if os.path.isfile(deckfile_location): + logger.debug("Is file location") + return ( + config.deckfile_selector.get(deckfile_location), + os.path.dirname(deckfile_location), + False, + ) + else: + raise RuntimeError(f"Cannot identify {location} as Deckfile") + elif protocol == "git": if "#" in location: ref, rev = location.split("#")