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.

30 lines
549 B

9 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. // ExecPath returns the executable path.
  15. func ExecPath() (string, error) {
  16. file, err := exec.LookPath(os.Args[0])
  17. if err != nil {
  18. return "", err
  19. }
  20. p, err := filepath.Abs(file)
  21. if err != nil {
  22. return "", err
  23. }
  24. return p, nil
  25. }