Added an onboarding flow

This commit is contained in:
Stash Dev
2019-02-11 02:49:39 -08:00
parent db42e43476
commit 77ffb65681
10 changed files with 203 additions and 69 deletions

View File

@@ -2,7 +2,6 @@ package paths
import (
"github.com/stashapp/stash/manager/jsonschema"
"github.com/stashapp/stash/utils"
)
type Paths struct {
@@ -15,14 +14,9 @@ type Paths struct {
SceneMarkers *sceneMarkerPaths
}
func RefreshPaths() *Paths {
ensureConfigFile()
return newPaths()
}
func newPaths() *Paths {
func NewPaths(config *jsonschema.Config) *Paths {
p := Paths{}
p.Config = jsonschema.LoadConfigFile(StaticPaths.ConfigFile)
p.Config = config
p.Generated = newGeneratedPaths(p)
p.JSON = newJSONPaths(p)
@@ -30,13 +24,4 @@ func newPaths() *Paths {
p.Scene = newScenePaths(p)
p.SceneMarkers = newSceneMarkerPaths(p)
return &p
}
func ensureConfigFile() {
configFileExists, _ := utils.FileExists(StaticPaths.ConfigFile) // TODO: Verify JSON is correct. Pass verified
if configFileExists {
return
}
panic("No config file found")
}