summaryrefslogtreecommitdiffstats
path: root/modules/base/base.go
blob: c9875fb50735113a803df7733bcbbb7d60b692a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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"
)

const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"

type (
	TplName string
)

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
}