From 9d54467f4ad8cc092384b59442dba9ec8413ff7f Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 24 May 2013 17:29:48 -0400 Subject: [PATCH] update --- gpm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpm.go b/gpm.go index bc525b6d1..69bf36a08 100644 --- a/gpm.go +++ b/gpm.go @@ -114,14 +114,16 @@ func getAppPath() bool { // Look up executable in PATH variable. appPath, _ = exec.LookPath(path.Base(os.Args[0])) // Check if run under $GOPATH/bin + if len(appPath) == 0 { fmt.Printf("ERROR: getAppPath -> Unable to indicate current execute path.\n") return false } + appPath += "/" if runtime.GOOS == "windows" { // Replace all '\' to '/'. - appPath = strings.Replace(filepath.Dir(appPath), "\\", "/", -1) + "/" + appPath = strings.Replace(filepath.Dir(appPath), "\\", "/", -1) } doc.SetAppConfig(appPath, config.AutoBackup)