Fix: resolve path in windows
This commit is contained in:
parent
b0e062dc7c
commit
91e35f2f6a
1 changed files with 6 additions and 6 deletions
12
main.go
12
main.go
|
@ -1,17 +1,17 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
"flag"
|
|
||||||
"path"
|
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/config"
|
"github.com/Dreamacro/clash/config"
|
||||||
|
C "github.com/Dreamacro/clash/constant"
|
||||||
"github.com/Dreamacro/clash/hub"
|
"github.com/Dreamacro/clash/hub"
|
||||||
"github.com/Dreamacro/clash/proxy"
|
"github.com/Dreamacro/clash/proxy"
|
||||||
"github.com/Dreamacro/clash/tunnel"
|
"github.com/Dreamacro/clash/tunnel"
|
||||||
C "github.com/Dreamacro/clash/constant"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
@ -30,10 +30,10 @@ func main() {
|
||||||
proxy.Instance().Run()
|
proxy.Instance().Run()
|
||||||
hub.Run()
|
hub.Run()
|
||||||
|
|
||||||
if (homedir != "") {
|
if homedir != "" {
|
||||||
if !path.IsAbs(homedir) {
|
if !filepath.IsAbs(homedir) {
|
||||||
currentDir, _ := os.Getwd()
|
currentDir, _ := os.Getwd()
|
||||||
homedir = path.Join(currentDir, homedir)
|
homedir = filepath.Join(currentDir, homedir)
|
||||||
}
|
}
|
||||||
C.SetHomeDir(homedir)
|
C.SetHomeDir(homedir)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue