summaryrefslogtreecommitdiffstats
path: root/models/publickey.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-02 15:25:09 -0500
committerUnknown <joe2010xtmf@163.com>2014-03-02 15:25:09 -0500
commite9487cb59cb7fcdc8891ccae93c33c9f587c576f (patch)
tree7335b615e6ad3a9b7dbfb674c31249da453be099 /models/publickey.go
parent9c3a8ff2994a34ff28484650aa400a0b167855f3 (diff)
downloadgitea-e9487cb59cb7fcdc8891ccae93c33c9f587c576f.tar.gz
gitea-e9487cb59cb7fcdc8891ccae93c33c9f587c576f.zip
Update
Diffstat (limited to 'models/publickey.go')
-rw-r--r--models/publickey.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/models/publickey.go b/models/publickey.go
index 86dd50e849..49863d8c0b 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -4,9 +4,10 @@ import (
"fmt"
"os"
"os/exec"
- "os/user"
"path/filepath"
"time"
+
+ "github.com/Unknwon/com"
)
var (
@@ -27,11 +28,11 @@ func exePath() (string, error) {
}
func homeDir() string {
- user, err := user.Current()
+ home, err := com.HomeDir()
if err != nil {
return "/"
}
- return user.HomeDir
+ return home
}
func init() {
@@ -68,7 +69,7 @@ func AddPublicKey(key *PublicKey) error {
if err != nil {
_, err2 := orm.Delete(key)
if err2 != nil {
- // TODO: logo the error
+ // TODO: log the error
}
return err
}