diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-04-05 20:06:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-05 20:06:41 +0200 |
| commit | 011b0bdec303783b6ce2a197957effef480ca50d (patch) | |
| tree | efb65ce331d7441260ee181127848ef36de4128f | |
| parent | e8cf1cac42316248cf2fe8d7aea486cf8d5affed (diff) | |
| parent | dc72ed8137ece14ae9a1a9f274a5c53ddf8c7ca0 (diff) | |
Merge pull request #619 from Akselmo/fix-path
Check for path length
| -rw-r--r-- | tools/odinfmt/main.odin | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/odinfmt/main.odin b/tools/odinfmt/main.odin index a912001..a829be6 100644 --- a/tools/odinfmt/main.odin +++ b/tools/odinfmt/main.odin @@ -90,6 +90,9 @@ main :: proc() { path := os.args[len(os.args) - 1] if strings.has_prefix(os.args[len(os.args) - 1], "-") { args_to_parse = os.args[1:] + } + + if len(path) <= 1 { path = "." // if no file was specified, use current directory as the starting path to look for `odinfmt.json` } @@ -186,4 +189,4 @@ main :: proc() { } os.exit(1 if write_failure else 0) -} +}
\ No newline at end of file |