Skip to content

Commit 9db22bb

Browse files
committed
If a compile_cmd is provided, Roosterize will first compile the project before suggest naming.
1 parent 0203197 commit 9db22bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

roosterize/interface/CommandLineInterface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class CommandLineInterface:
4747
"serapi_options",
4848
"exclude_files",
4949
"exclude_pattern",
50+
"compile_cmd",
5051
]
5152

5253
def __init__(self):
@@ -61,6 +62,7 @@ def __init__(self):
6162
self.exclude_pattern = None
6263
self.serapi_options = None
6364
self.model_url = "https://github.com/EngineeringSoftware/roosterize/releases/download/v1.1.0+8.10.0/roosterize-model-t1.tgz"
65+
self.compile_cmd = None
6466
self.loaded_config_prj: Path = None
6567

6668
self.load_configs()
@@ -168,6 +170,11 @@ def suggest_naming(self, file_path: Path, prj_root: Optional[Path] = None):
168170
# Infer SerAPI options
169171
serapi_options = self.infer_serapi_options(prj_root)
170172

173+
# If user provided compile_cmd, first compile the project
174+
if self.compile_cmd is not None:
175+
with IOUtils.cd(prj_root):
176+
BashUtils.run(self.compile_cmd, expected_return_code=0)
177+
171178
# Parse file
172179
data = self.parse_file(file_path, prj_root, serapi_options)
173180

0 commit comments

Comments
 (0)