Project configs
This commit is contained in:
@@ -896,26 +896,21 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
String project_config = {};
|
||||
for (int i = 1; i < argc; i += 1) {
|
||||
String it = argv[i];
|
||||
if (EndsWith(it, ".te")) {
|
||||
project_config = it;
|
||||
}
|
||||
Open(argv[i]);
|
||||
}
|
||||
|
||||
{
|
||||
Scratch scratch;
|
||||
String exe_dir = GetExeDir(scratch);
|
||||
String config_path = Format(scratch, "%S/config.te", exe_dir);
|
||||
Window *window = GetWindow(NullWindowID);
|
||||
View *view = WindowOpenBufferView(window, config_path);
|
||||
Buffer *buffer = GetBuffer(view->active_buffer);
|
||||
buffer->special = true;
|
||||
GlobalConfigBufferID = buffer->id;
|
||||
EvalCommandsLineByLine({window, view, buffer});
|
||||
if (window->active_view == view->id) {
|
||||
window->active_view = NullViewID;
|
||||
}
|
||||
Scratch scratch;
|
||||
GlobalConfigBufferID = LoadConfig(Format(scratch, "%S/config.te", GetExeDir(scratch)));
|
||||
if (project_config.len) {
|
||||
LoadConfig(project_config);
|
||||
}
|
||||
|
||||
|
||||
ReportConsolef(":Set WorkDir '%S'", WorkDir);
|
||||
if (Testing) InitTests();
|
||||
#if OS_WINDOWS
|
||||
|
||||
Reference in New Issue
Block a user