Merge from remote branch
This commit is contained in:
@ -18,7 +18,8 @@ const (
|
||||
|
||||
HTTP Type = iota
|
||||
HTTPCONNECT
|
||||
SOCKS
|
||||
SOCKS4
|
||||
SOCKS5
|
||||
REDIR
|
||||
TPROXY
|
||||
TUN
|
||||
@ -47,7 +48,9 @@ func (t Type) String() string {
|
||||
return "HTTP"
|
||||
case HTTPCONNECT:
|
||||
return "HTTP Connect"
|
||||
case SOCKS:
|
||||
case SOCKS4:
|
||||
return "Socks4"
|
||||
case SOCKS5:
|
||||
return "Socks5"
|
||||
case REDIR:
|
||||
return "Redir"
|
||||
|
@ -9,21 +9,19 @@ import (
|
||||
const Name = "clash"
|
||||
|
||||
// Path is used to get the configuration path
|
||||
var Path *path
|
||||
|
||||
type path struct {
|
||||
homeDir string
|
||||
configFile string
|
||||
}
|
||||
|
||||
func init() {
|
||||
var Path = func() *path {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
homeDir, _ = os.Getwd()
|
||||
}
|
||||
|
||||
homeDir = P.Join(homeDir, ".config", Name)
|
||||
Path = &path{homeDir: homeDir, configFile: "config.yaml"}
|
||||
return &path{homeDir: homeDir, configFile: "config.yaml"}
|
||||
}()
|
||||
|
||||
type path struct {
|
||||
homeDir string
|
||||
configFile string
|
||||
}
|
||||
|
||||
// SetHomeDir is used to set the configuration path
|
||||
|
Reference in New Issue
Block a user