From 91e35f2f6a4a006e87682f91cf5e151b86c57fc0 Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Wed, 14 Nov 2018 20:58:10 +0800 Subject: [PATCH] Fix: resolve path in windows --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 7273c4d5..b4810625 100644 --- a/main.go +++ b/main.go @@ -1,17 +1,17 @@ package main import ( + "flag" "os" "os/signal" + "path/filepath" "syscall" - "flag" - "path" "github.com/Dreamacro/clash/config" + C "github.com/Dreamacro/clash/constant" "github.com/Dreamacro/clash/hub" "github.com/Dreamacro/clash/proxy" "github.com/Dreamacro/clash/tunnel" - C "github.com/Dreamacro/clash/constant" log "github.com/sirupsen/logrus" ) @@ -30,10 +30,10 @@ func main() { proxy.Instance().Run() hub.Run() - if (homedir != "") { - if !path.IsAbs(homedir) { + if homedir != "" { + if !filepath.IsAbs(homedir) { currentDir, _ := os.Getwd() - homedir = path.Join(currentDir, homedir) + homedir = filepath.Join(currentDir, homedir) } C.SetHomeDir(homedir) }