aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-08 16:59:56 -0500
committerUnknwon <u@gogs.io>2015-11-08 16:59:56 -0500
commit18c841050b4c843ef723e788d4c0a4c29c67ffe3 (patch)
tree05fa3bde8473045add17f4efe9a0ba141b178bf7 /modules/base
parentb55499d039c5e35130057b8af16401c558e79e79 (diff)
downloadgitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.tar.gz
gitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.zip
fix 1540 and experimental SSH server support
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/base.go19
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
+}