mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Use custom.css is same path as config file (#175)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
@@ -123,12 +124,11 @@ func ValidateCredentials(username string, password string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetCSSPath() string {
|
func GetCSSPath() string {
|
||||||
// search for custom.css in current directory, then $HOME/.stash
|
// use custom.css in the same directory as the config file
|
||||||
fn := "custom.css"
|
configFileUsed := viper.ConfigFileUsed()
|
||||||
exists, _ := utils.FileExists(fn)
|
configDir := filepath.Dir(configFileUsed)
|
||||||
if !exists {
|
|
||||||
fn = "$HOME/.stash/" + fn
|
fn := filepath.Join(configDir, "custom.css")
|
||||||
}
|
|
||||||
|
|
||||||
return fn
|
return fn
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user