aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-08 22:09:11 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-12-08 22:09:11 +0100
commitbeb7c5e33747432f9d4d8b99838e752eb5fa6871 (patch)
treedfbaf544e810d4c0995fe3b0cfe90a637d5d0ed7
parent19705527a0b24236af12e279f4e184bac174ba68 (diff)
downloadgallery-beb7c5e33747432f9d4d8b99838e752eb5fa6871.tar.gz
gallery-beb7c5e33747432f9d4d8b99838e752eb5fa6871.tar.xz
gallery-beb7c5e33747432f9d4d8b99838e752eb5fa6871.zip
gallery: create DB directory in initialization
So that README.adoc instructions actually work.
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index c4f222e..23087c0 100644
--- a/main.go
+++ b/main.go
@@ -296,6 +296,9 @@ func cmdInit(fs *flag.FlagSet, args []string) error {
if fs.NArg() != 1 {
return errWrongUsage
}
+ if err := os.MkdirAll(fs.Arg(0), 0755); err != nil {
+ return err
+ }
if err := openDB(fs.Arg(0)); err != nil {
return err
}