|
64 | 64 | os.remove(pn(os.getcwd()+"/PolishCookieConsent/src/cookieBase/PCB.txt"))
|
65 | 65 | shutil.copy(pn(os.getcwd()+"/PCCassets/plCDB.txt"), pn(os.getcwd()+"/PolishCookieConsent/src/cookieBase/PCB.txt"))
|
66 | 66 |
|
| 67 | + print(f"Entering directory: {pn(os.getcwd()+"/PolishCookieConsent")}") |
67 | 68 | os.chdir(pn(os.getcwd()+"/PolishCookieConsent"))
|
68 | 69 |
|
69 |
| - git_repo = git.Repo(pn(os.getcwd()), search_parent_directories=True) |
70 |
| - |
71 |
| - class conf(): |
72 |
| - def __init__(self): |
73 |
| - if os.path.isfile(config_path): |
74 |
| - with open(config_path, "r", encoding="utf8") as cf: |
75 |
| - for lineConf in cf: |
76 |
| - cfProperty = lineConf.strip().split()[ |
77 |
| - 0].replace("@", "") |
78 |
| - if matchC := re.search(r'@'+cfProperty+' (.*)$', lineConf): |
79 |
| - self[cfProperty] = matchC.group(1) |
80 |
| - def __setitem__(self, key, value): |
81 |
| - setattr(self, key, value) |
82 |
| - def __getitem__(self, key): |
83 |
| - return getattr(self, key) |
| 70 | + git_repo = git.Repo(os.getcwd()) |
84 | 71 |
|
85 |
| - if "CI" in os.environ: |
| 72 | + if "CI" in os.environ and "git_repo" in locals(): |
| 73 | + conf = SFLB.getValuesFromConf([config_path]) |
86 | 74 | with git_repo.config_writer() as cw:
|
87 | 75 | if hasattr(conf(), 'CIusername'):
|
88 | 76 | cw.set_value("user", "name", conf().CIusername).release()
|
|
0 commit comments