Fixed Config.CreateDirectories()

This commit is contained in:
Michael Mayer 2018-09-18 16:34:08 +02:00
parent 1af143d806
commit de494fb8f8
3 changed files with 15 additions and 18 deletions

View file

@ -10,13 +10,11 @@ services:
- 80:80 # left side is your local port (change if port 80 is already used)
volumes:
- ~/Photos:/Photos # change ~/Photos to whatever directory you want to use on your local computer
- photoprism-thumbnails:/var/photoprism/thumbnails # keep this
- photoprism-thumbnails:/var/photoprism/thumbnails # keep this (thumbnail cache)
environment:
PHOTOPRISM_ASSETS_PATH: /var/photoprism # keep this
PHOTOPRISM_THUMBNAILS_PATH: /var/photoprism/thumbnails # keep this
PHOTOPRISM_IMPORT_PATH: /Photos/Import # ~/Photos/Import (files to be imported to originals)
PHOTOPRISM_EXPORT_PATH: /Photos/Export # ~/Photos/Export (files exported from originals)
PHOTOPRISM_ORIGINALS_PATH: /Photos/Originals # ~/Photos/Originals (original jpeg, raw and meta files)
PHOTOPRISM_IMPORT_PATH: "/Photos/Import" # ~/Photos/Import (files to be imported to originals)
PHOTOPRISM_EXPORT_PATH: "/Photos/Export" # ~/Photos/Export (files exported from originals)
PHOTOPRISM_ORIGINALS_PATH: "/Photos/Originals" # ~/Photos/Originals (original jpeg, raw and meta files)
database: # keep this
image: mysql:latest

View file

@ -10,13 +10,13 @@ services:
volumes:
- .:/go/src/github.com/photoprism/photoprism
environment:
PHOTOPRISM_DEBUG: true
PHOTOPRISM_SERVER_MODE: debug
PHOTOPRISM_ASSETS_PATH: /go/src/github.com/photoprism/photoprism/assets
PHOTOPRISM_THUMBNAILS_PATH: /go/src/github.com/photoprism/photoprism/assets/thumbnails
PHOTOPRISM_IMPORT_PATH: /go/src/github.com/photoprism/photoprism/assets/photos/import
PHOTOPRISM_EXPORT_PATH: /var/photoprism/photos/export
PHOTOPRISM_ORIGINALS_PATH: /go/src/github.com/photoprism/photoprism/assets/photos/originals
PHOTOPRISM_DEBUG: "true"
PHOTOPRISM_SERVER_MODE: "debug"
PHOTOPRISM_ASSETS_PATH: "/go/src/github.com/photoprism/photoprism/assets"
PHOTOPRISM_THUMBNAILS_PATH: "/go/src/github.com/photoprism/photoprism/assets/thumbnails"
PHOTOPRISM_IMPORT_PATH: "/go/src/github.com/photoprism/photoprism/assets/photos/import"
PHOTOPRISM_EXPORT_PATH: "/go/src/github.com/photoprism/photoprism/assets/photos/export"
PHOTOPRISM_ORIGINALS_PATH: "/go/src/github.com/photoprism/photoprism/assets/photos/originals"
database:
image: mysql:latest

View file

@ -11,7 +11,6 @@ import (
"github.com/urfave/cli"
"log"
"os"
"path"
"time"
)
@ -143,19 +142,19 @@ func (c *Config) SetValuesFromCliContext(context *cli.Context) error {
}
func (c *Config) CreateDirectories() error {
if err := os.MkdirAll(path.Dir(c.OriginalsPath), os.ModePerm); err != nil {
if err := os.MkdirAll(c.OriginalsPath, os.ModePerm); err != nil {
return err
}
if err := os.MkdirAll(path.Dir(c.ThumbnailsPath), os.ModePerm); err != nil {
if err := os.MkdirAll(c.ThumbnailsPath, os.ModePerm); err != nil {
return err
}
if err := os.MkdirAll(path.Dir(c.ImportPath), os.ModePerm); err != nil {
if err := os.MkdirAll(c.ImportPath, os.ModePerm); err != nil {
return err
}
if err := os.MkdirAll(path.Dir(c.ExportPath), os.ModePerm); err != nil {
if err := os.MkdirAll(c.ExportPath, os.ModePerm); err != nil {
return err
}