Skip to content

Commit 8a956b9

Browse files
committed
Make sure config dir exists for ioc.db
Also added config dir to gitignore
1 parent 02c5671 commit 8a956b9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ target/
6464
.venv*
6565
venv*
6666

67-
# Built bob files
67+
# Built synoptic files
6868
**/data/
69+
**/config/
6970

7071
# further build artifacts
7172
lockfiles/

src/techui_builder/builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import logging
3+
import os
34
from collections import defaultdict
45
from dataclasses import _MISSING_TYPE, dataclass, field
56
from pathlib import Path
@@ -109,8 +110,10 @@ def _create_devsta_pv(self, prefix: str, inputs: list[str]):
109110
self.devsta_pvs[prefix] = devsta_pv
110111

111112
def write_devsta_pvs(self):
112-
devsta_file = self._write_directory.parent.joinpath("config/ioc.db")
113-
with open(devsta_file, "w") as f:
113+
conf_dir = self._write_directory.parent.joinpath("config")
114+
if not conf_dir.exists():
115+
os.mkdir(conf_dir)
116+
with open(conf_dir.joinpath("ioc.db"), "w") as f:
114117
for dpv in self.devsta_pvs.values():
115118
dpv.Print(f)
116119
# f.write(str(dpv))

0 commit comments

Comments
 (0)