summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-09-24 13:30:39 -0400
committerpommicket <pommicket@gmail.com>2022-09-24 13:38:12 -0400
commitdfde7bff94240172d3a2a037ec0b77871b71bf56 (patch)
treea813f5df460300235e88595c018687a5c743be19 /build.c
parent8965fd92759602c1c92c025344c1bb801bc15043 (diff)
fix go-to-error when build_dir != .
Diffstat (limited to 'build.c')
-rw-r--r--build.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.c b/build.c
index 3f4cc57..f5b916a 100644
--- a/build.c
+++ b/build.c
@@ -101,14 +101,18 @@ static void build_start(Ted *ted) {
ted_path_full(ted, "../..", ted->build_dir, sizeof ted->build_dir);
cargo = true;
} else
- // Check if Makefile exists in this or the parent directory
+ // Check if Makefile exists in this or the parent/parent's parent directory
if (fs_file_exists("Makefile")) {
make = true;
} else if (fs_file_exists(".." PATH_SEPARATOR_STR "Makefile")) {
ted_path_full(ted, "..", ted->build_dir, sizeof ted->build_dir);
make = true;
+ } else if (fs_file_exists(".." PATH_SEPARATOR_STR ".." PATH_SEPARATOR_STR "Makefile")) {
+ ted_path_full(ted, "../..", ted->build_dir, sizeof ted->build_dir);
+ make = true;
}
+
// @TODO(eventually): `go build`
if (cargo) {