diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-04-26 22:16:03 +0200 |
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-04-26 22:16:03 +0200 |
| commit | 8ad06294d6d9c7a67a32099e31c93b4f08b9aff2 (patch) | |
| tree | 02edb46f1f283cca6df8d115c97096d97b1baae6 /crocc.go | |
| parent | 8f4d8fbc593dfa3dfcf4ad132d01f23cffda360c (diff) | |
Fix missing outdir bug
crocc was not creating the output directory if it was not present, making it impossible to generate files
Diffstat (limited to 'crocc.go')
| -rw-r--r-- | crocc.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -81,6 +81,10 @@ func main() { // Check output directory if _, err := os.Stat(*out); !os.IsNotExist(err) { log.Fatalf("output directory %q already exists", *out) + } else { + if err := os.MkdirAll(*out, 0755); err != nil { + log.Fatalf("unable to create output directory %q: %v", *out, err) + } } // Retrieve template file |
