0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-26 17:34:11 -05:00
forgejo/modules/base/base.go

33 lines
589 B
Go
Raw Normal View History

2014-03-06 02:21:44 -05: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
import (
"os"
"os/exec"
"path/filepath"
)
2015-08-28 22:49:59 -05:00
const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
2014-11-14 17:11:30 -05:00
2014-03-06 02:21:44 -05:00
type (
2014-07-25 23:24:27 -05:00
TplName string
2014-03-06 02:21:44 -05:00
)
2014-04-13 00:57:42 -05:00
2014-04-13 03:27:29 -05:00
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
}