diff options
author | pommicket <pommicket@gmail.com> | 2023-01-11 22:59:03 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-11 22:59:03 -0500 |
commit | 0c102146685ad0707ddb7e2f8ea1166782c1e76d (patch) | |
tree | 6576a100d629de66a117eb60b547f17e800969c4 /build.c | |
parent | b01c7b595cabce4704b6e5e6ead61bdebdedc923 (diff) |
build-command setting + a bunch of config fixes
- now we only show the first config error
- path matching is now ranked more highly than language matching
- paths with forward slashes are now handled for Windows path-specific
settings
Diffstat (limited to 'build.c')
-rw-r--r-- | build.c | 37 |
1 files changed, 20 insertions, 17 deletions
@@ -86,26 +86,29 @@ void build_start_with_command(Ted *ted, const char *command) { void build_start(Ted *ted) { Settings *settings = ted_active_settings(ted); - char *command = settings->build_default_command; + char *command = settings->build_command; char *root = ted_get_root_dir(ted); strbuf_cpy(ted->build_dir, root); - change_directory(root); - free(root); - -#if _WIN32 - if (fs_file_exists("make.bat")) { - command = "make.bat"; - } else -#endif - if (fs_file_exists("Cargo.toml")) { - command = "cargo build"; - } else if (fs_file_exists("Makefile")) { - command = "make -j12"; - } else if (fs_file_exists("go.mod")) { - command = "go build"; - } + if (*command == 0) { + command = settings->build_default_command; + change_directory(root); - build_start_with_command(ted, command); + #if _WIN32 + if (fs_file_exists("make.bat")) { + command = "make.bat"; + } else + #endif + if (fs_file_exists("Cargo.toml")) { + command = "cargo build"; + } else if (fs_file_exists("Makefile")) { + command = "make -j16"; + } else if (fs_file_exists("go.mod")) { + command = "go build"; + } + } + free(root); + if (*command) + build_start_with_command(ted, command); } static void build_go_to_error(Ted *ted) { |