mirror of https://github.com/stashapp/stash.git
Create default config directory during setup (#1623)
* Create default config directory during setup Instead of creating the config directory during startup, create it during setup when needed. Fixes #1616
This commit is contained in:
parent
59c7dd622b
commit
915533b8c5
|
@ -58,7 +58,6 @@ func GetInstance() *singleton {
|
|||
|
||||
func Initialize() *singleton {
|
||||
once.Do(func() {
|
||||
_ = utils.EnsureDir(paths.GetStashHomeDirectory())
|
||||
cfg, err := config.Initialize()
|
||||
|
||||
if err != nil {
|
||||
|
@ -269,6 +268,14 @@ func setSetupDefaults(input *models.SetupInput) {
|
|||
func (s *singleton) Setup(input models.SetupInput) error {
|
||||
setSetupDefaults(&input)
|
||||
|
||||
// create the config directory if it does not exist
|
||||
configDir := filepath.Dir(input.ConfigLocation)
|
||||
if exists, _ := utils.DirExists(configDir); !exists {
|
||||
if err := os.Mkdir(configDir, 0755); err != nil {
|
||||
return fmt.Errorf("abc: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// create the generated directory if it does not exist
|
||||
if exists, _ := utils.DirExists(input.GeneratedLocation); !exists {
|
||||
if err := os.Mkdir(input.GeneratedLocation, 0755); err != nil {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* Added de-DE language option. ([#1578](https://github.com/stashapp/stash/pull/1578))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Create .stash directory in $HOME only if required. ([#1623](https://github.com/stashapp/stash/pull/1623))
|
||||
* Include stash id when scraping performer from stash-box. ([#1608](https://github.com/stashapp/stash/pull/1608))
|
||||
* Fix infinity framerate values causing resolver error. ([#1607](https://github.com/stashapp/stash/pull/1607))
|
||||
* Fix unsetting performer gender not working correctly. ([#1606](https://github.com/stashapp/stash/pull/1606))
|
||||
|
|
Loading…
Reference in New Issue