2014-03-06 08:21:44 +01:00
|
|
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package base
|
|
|
|
|
2015-11-08 22:59:56 +01:00
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
2015-08-29 05:49:59 +02:00
|
|
|
const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
|
2014-11-14 23:11:30 +01:00
|
|
|
|
2014-03-06 08:21:44 +01:00
|
|
|
type (
|
2014-07-26 06:24:27 +02:00
|
|
|
TplName string
|
2014-03-06 08:21:44 +01:00
|
|
|
)
|
2014-04-13 07:57:42 +02:00
|
|
|
|
2014-04-13 10:27:29 +02:00
|
|
|
var GoGetMetas = make(map[string]bool)
|
2015-11-08 22:59:56 +01:00
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|