summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst@digdash.com>2025-01-23 14:49:10 +0100
committerJulian Hurst <julian.hurst@digdash.com>2025-01-23 14:49:10 +0100
commit79fde8d68f3366415cffd0da5022a3582438b468 (patch)
treef95a52ead38c3bf3e00f5b1c195e4d0c1ff45230 /main.go
parent67cc5aa9b0d1bae03c425a2020feabd7bb45898f (diff)
downloadbox-79fde8d68f3366415cffd0da5022a3582438b468.tar.gz
Fix mkdir issue when files path is empty
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.go b/main.go
index 8a3e3b8..aeb0100 100644
--- a/main.go
+++ b/main.go
@@ -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))