aboutsummaryrefslogtreecommitdiff
path: root/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-17 23:07:40 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-17 23:07:40 -0400
commitf6eda4cf855fdf613cbcde0b073adfde43b354e7 (patch)
tree7137bc20067202b0d0da1bca68a4df4d337df9d4 /tomo.c
parent908373f6193bdaa8ac611c139a12a354a546aafa (diff)
Support running a directory directly
Diffstat (limited to 'tomo.c')
-rw-r--r--tomo.c7
1 files changed, 7 insertions, 0 deletions
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)