feat: create cache directory on startup
the flag is still required - but the path need not exist
the folder will eventually be created by one of
if err := os.MkdirAll(cacheDirAudio, os.ModePerm); err != nil {
if err := os.MkdirAll(cacheDirCovers, os.ModePerm); err != nil {
fixes #127
This commit is contained in:
@@ -68,13 +68,13 @@ func main() {
|
||||
if _, err := os.Stat(*confPodcastPath); os.IsNotExist(err) {
|
||||
log.Fatal("please provide a valid podcast directory")
|
||||
}
|
||||
if _, err := os.Stat(*confCachePath); os.IsNotExist(err) {
|
||||
log.Fatal("please provide a valid cache directory")
|
||||
|
||||
if *confCachePath == "" {
|
||||
log.Fatal("please provide a cache directory")
|
||||
}
|
||||
|
||||
cacheDirAudio := path.Join(*confCachePath, cachePrefixAudio)
|
||||
cacheDirCovers := path.Join(*confCachePath, cachePrefixCovers)
|
||||
|
||||
if _, err := os.Stat(cacheDirAudio); os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(cacheDirAudio, os.ModePerm); err != nil {
|
||||
log.Fatalf("couldn't create audio cache path: %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user