fixed totp and go mod

This commit is contained in:
ston1th 2019-05-04 21:51:48 +02:00
commit 3a3140875e
297 changed files with 52714 additions and 15245 deletions

View file

@ -3,6 +3,7 @@ package fs
import (
"errors"
"git.giftfish.de/ston1th/docstore/pkg/core"
"git.giftfish.de/ston1th/docstore/pkg/log"
"os"
"path/filepath"
"sort"
@ -31,7 +32,15 @@ func NewFilesystem(base string) (fs *Filesystem, err error) {
}
fi, err := os.Stat(base)
if err != nil {
return
err = os.Mkdir(base, DirMode)
if err != nil {
return
}
log.Printf("fs: created data directory '%s'", base)
fi, err = os.Stat(base)
if err != nil {
return
}
}
if !fi.IsDir() {
err = errors.New("base dir '" + base + "' is not a directory")