Monorepo for Tangled tangled.org
856
fork

Configure Feed

Select the types of activity you want to include in your feed.

hook/setup: auto-create scan path if missing

authored by

Jes Olson and committed by
Tangled
4eb8cf9a e6e70541

+4
+4
hook/setup.go
··· 5 5 import ( 6 6 "errors" 7 7 "fmt" 8 + "io/fs" 8 9 "os" 9 10 "path/filepath" 10 11 "strings" ··· 54 55 func Setup(config config) error { 55 56 // iterate over all directories in current directory: 56 57 repoDirs, err := os.ReadDir(config.scanPath) 58 + if errors.Is(err, fs.ErrNotExist) { 59 + return os.MkdirAll(config.scanPath, 0755) 60 + } 57 61 if err != nil { 58 62 return err 59 63 }