Support string only gather_prepopulate

This commit is contained in:
Mustafa Gezen 2022-10-31 16:24:29 +01:00
parent 147aedf354
commit 9a4d612f9b
Signed by: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -33,8 +33,13 @@ import os
class SCM: class SCM:
def __init__(self, pungi_base, scm_dict): def __init__(self, pungi_base, scm_dict):
if scm_dict["scm"] == "file": if isinstance(scm_dict, str) or scm_dict["scm"] == "file":
file_path = os.path.join(pungi_base, scm_dict["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") f = open(file_path, "r")
file_contents = f.read() file_contents = f.read()