You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
589 B

9 years ago
10 years ago
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package base
  5. import (
  6. "os"
  7. "os/exec"
  8. "path/filepath"
  9. )
  10. const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
  11. type (
  12. TplName string
  13. )
  14. var GoGetMetas = make(map[string]bool)
  15. // ExecPath returns the executable path.
  16. func ExecPath() (string, error) {
  17. file, err := exec.LookPath(os.Args[0])
  18. if err != nil {
  19. return "", err
  20. }
  21. p, err := filepath.Abs(file)
  22. if err != nil {
  23. return "", err
  24. }
  25. return p, nil
  26. }