From 9a4d612f9b57241865305ad282713eb3c20434c8 Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Mon, 31 Oct 2022 16:24:29 +0100 Subject: [PATCH] Support string only gather_prepopulate --- pungicatalog/scm.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pungicatalog/scm.py b/pungicatalog/scm.py index f31ce02..0185c97 100644 --- a/pungicatalog/scm.py +++ b/pungicatalog/scm.py @@ -33,8 +33,13 @@ import os class SCM: def __init__(self, pungi_base, scm_dict): - if scm_dict["scm"] == "file": - file_path = os.path.join(pungi_base, scm_dict["file"]) + if isinstance(scm_dict, str) or scm_dict["scm"] == "file": + file_path = "" + if not isinstance(scm_dict, str): + file_path = os.path.join(pungi_base, scm_dict["file"]) + else: + file_path = os.path.join(pungi_base, scm_dict) + f = open(file_path, "r") file_contents = f.read()