Browse Source

Code fix

pull/103/head
Unknown 12 years ago
parent
commit
393d351826
  1. 2
      cmd/get.go
  2. 2
      cmd/serve.go
  3. 18
      doc/utils.go

2
cmd/get.go

@ -120,7 +120,7 @@ func runGet(cmd *Command, args []string) {
return
}
hd, err := doc.GetHomeDir()
hd, err := com.HomeDir()
if err != nil {
com.ColorLog("[ERRO] Fail to get current user[ %s ]\n", err)
return

2
cmd/serve.go

@ -332,7 +332,7 @@ func runningStatus() (int, int, int) {
}
func startService(listen string) {
homeDir, err := doc.GetHomeDir()
homeDir, err := com.HomeDir()
if err != nil {
fmt.Println(err)
return

18
doc/utils.go

@ -16,10 +16,8 @@ package doc
import (
"os"
"os/user"
"path"
"regexp"
"runtime"
"strings"
"github.com/Unknwon/com"
@ -620,22 +618,6 @@ func IsGoRepoPath(importPath string) bool {
return standardPath[importPath]
}
func GetHomeDir() (string, error) {
if runtime.GOOS != "windows" {
curUser, err := user.Current()
if err != nil {
return "", err
}
return curUser.HomeDir, nil
} else {
hd, err := com.HomeDir()
if err != nil {
return "", err
}
return hd, nil
}
}
func CheckNodeValue(v string) string {
if len(v) == 0 {
return "<UTD>"

Loading…
Cancel
Save