From f6eda4cf855fdf613cbcde0b073adfde43b354e7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 17 Mar 2025 23:07:40 -0400 Subject: Support running a directory directly --- tomo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tomo.c b/tomo.c index 1115c43c..15dcad86 100644 --- a/tomo.c +++ b/tomo.c @@ -167,6 +167,13 @@ int main(int argc, char *argv[]) return 0; } + // Convert `foo` to `foo/foo.tm` + for (int64_t i = 0; i < files.length; i++) { + Path_t *path = (Path_t*)(files.data + i*files.stride); + if (Path$is_directory(*path, true)) + *path = Path$with_component(*path, Texts(Path$base_name(*path), Text(".tm"))); + } + // Run file directly: if (!stop_at_transpile && !stop_at_obj_compilation && !stop_at_exe_compilation) { if (files.length < 1) -- cgit v1.2.3