forgejo-federation/modules/base/base.go

33 lines
589 B
Go
Raw Normal View History

2014-03-06 12:51:44 +05:30
// 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
import (
"os"
"os/exec"
"path/filepath"
)
2015-08-29 09:19:59 +05:30
const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
2014-11-15 03:41:30 +05:30
2014-03-06 12:51:44 +05:30
type (
2014-07-26 09:54:27 +05:30
TplName string
2014-03-06 12:51:44 +05:30
)
2014-04-13 11:27:42 +05:30
2014-04-13 13:57:29 +05:30
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
}