diff options
| author | Julian Hurst <julian.hurst@digdash.com> | 2025-01-23 14:49:10 +0100 |
|---|---|---|
| committer | Julian Hurst <julian.hurst@digdash.com> | 2025-01-23 14:49:10 +0100 |
| commit | 79fde8d68f3366415cffd0da5022a3582438b468 (patch) | |
| tree | f95a52ead38c3bf3e00f5b1c195e4d0c1ff45230 | |
| parent | 67cc5aa9b0d1bae03c425a2020feabd7bb45898f (diff) | |
| download | box-79fde8d68f3366415cffd0da5022a3582438b468.tar.gz | |
Fix mkdir issue when files path is empty
| -rw-r--r-- | main.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -117,9 +117,11 @@ func main() { *token, *deleteEnabled, } - err := os.MkdirAll(boxHandler.filesPath, 0750) - if err != nil { - log.Fatal(err) + if boxHandler.filesPath != "" { + err := os.MkdirAll(boxHandler.filesPath, 0750) + if err != nil { + log.Fatal(err) + } } log.Printf("Listening on %s:%d", *host, *port) log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", *host, *port), boxHandler)) |
