Feature: update config API support raw yaml payload
This commit is contained in:
@ -3,6 +3,7 @@ package constant
|
||||
import (
|
||||
"os"
|
||||
P "path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
const Name = "clash"
|
||||
@ -43,6 +44,15 @@ func (p *path) Config() string {
|
||||
return p.configFile
|
||||
}
|
||||
|
||||
// Reslove return a absolute path or a relative path with homedir
|
||||
func (p *path) Reslove(path string) string {
|
||||
if !filepath.IsAbs(path) {
|
||||
return filepath.Join(p.HomeDir(), path)
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
|
||||
func (p *path) MMDB() string {
|
||||
return P.Join(p.homeDir, "Country.mmdb")
|
||||
}
|
||||
|
Reference in New Issue
Block a user