diff options
author | Unknwon <u@gogs.io> | 2015-11-08 16:59:56 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-08 16:59:56 -0500 |
commit | 18c841050b4c843ef723e788d4c0a4c29c67ffe3 (patch) | |
tree | 05fa3bde8473045add17f4efe9a0ba141b178bf7 /modules/base/base.go | |
parent | b55499d039c5e35130057b8af16401c558e79e79 (diff) | |
download | gitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.tar.gz gitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.zip |
fix 1540 and experimental SSH server support
Diffstat (limited to 'modules/base/base.go')
-rw-r--r-- | modules/base/base.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/base/base.go b/modules/base/base.go index 864ede055f..c9875fb507 100644 --- a/modules/base/base.go +++ b/modules/base/base.go @@ -4,6 +4,12 @@ package base +import ( + "os" + "os/exec" + "path/filepath" +) + const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki" type ( @@ -11,3 +17,16 @@ type ( ) var GoGetMetas = make(map[string]bool) + +// ExecPath returns the executable path. +func ExecPath() (string, error) { + file, err := exec.LookPath(os.Args[0]) + if err != nil { + return "", err + } + p, err := filepath.Abs(file) + if err != nil { + return "", err + } + return p, nil +} |