Skip to content

Commit c30d453

Browse files
committed
update os.exe path
1 parent df6fa8b commit c30d453

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/http"
1010
"net/http/cookiejar"
1111
"os"
12+
"path/filepath"
1213
"strconv"
1314
"strings"
1415
)
@@ -47,12 +48,13 @@ func main() {
4748
println("please set url with --url or -h for help")
4849
return
4950
}
50-
path, err := os.Getwd()
51+
ex, err := os.Executable()
5152
if err != nil {
52-
println(err.Error())
53-
return
53+
panic(err)
5454
}
55-
configfilepath := path + "/SensitiveList.json"
55+
exPath := filepath.Dir(ex)
56+
57+
configfilepath := exPath + "/SensitiveList.json"
5658
if *configfile != "" {
5759
configfilepath = *configfile
5860
}

0 commit comments

Comments
 (0)