mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
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:
@@ -58,7 +58,6 @@ func GetInstance() *singleton {
|
|||||||
|
|
||||||
func Initialize() *singleton {
|
func Initialize() *singleton {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
_ = utils.EnsureDir(paths.GetStashHomeDirectory())
|
|
||||||
cfg, err := config.Initialize()
|
cfg, err := config.Initialize()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -269,6 +268,14 @@ func setSetupDefaults(input *models.SetupInput) {
|
|||||||
func (s *singleton) Setup(input models.SetupInput) error {
|
func (s *singleton) Setup(input models.SetupInput) error {
|
||||||
setSetupDefaults(&input)
|
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
|
// create the generated directory if it does not exist
|
||||||
if exists, _ := utils.DirExists(input.GeneratedLocation); !exists {
|
if exists, _ := utils.DirExists(input.GeneratedLocation); !exists {
|
||||||
if err := os.Mkdir(input.GeneratedLocation, 0755); err != nil {
|
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))
|
* Added de-DE language option. ([#1578](https://github.com/stashapp/stash/pull/1578))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 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))
|
* 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 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))
|
* Fix unsetting performer gender not working correctly. ([#1606](https://github.com/stashapp/stash/pull/1606))
|
||||||
|
|||||||
Reference in New Issue
Block a user