summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-25 22:48:04 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-25 22:48:04 -0500
commit515641d0338881560832a48e30f213663f244b68 (patch)
tree334b1d5cf3f30d68c2c7dbff67cd8520b54e6d08
parent54d25c13d7a5f52d44680626c45d84d0193091a0 (diff)
downloadgitea-515641d0338881560832a48e30f213663f244b68.tar.gz
gitea-515641d0338881560832a48e30f213663f244b68.zip
fix #659
-rw-r--r--cmd/fix.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/fix.go b/cmd/fix.go
index dfcd04aa89..5122ff32c7 100644
--- a/cmd/fix.go
+++ b/cmd/fix.go
@@ -14,6 +14,7 @@ import (
"runtime"
"strings"
+ "github.com/Unknwon/com"
"github.com/codegangsta/cli"
"github.com/gogits/gogs/models"
@@ -164,10 +165,12 @@ func runFixLocation(ctx *cli.Context) {
// Fix in authorized_keys file.
sshPath := path.Join(models.SshPath, "authorized_keys")
- fmt.Printf("Fixing pathes in file: %s\n", sshPath)
- if err := rewriteAuthorizedKeys(sshPath, oldPath, execPath); err != nil {
- fmt.Println(err)
- os.Exit(1)
+ if com.IsFile(sshPath) {
+ fmt.Printf("Fixing pathes in file: %s\n", sshPath)
+ if err := rewriteAuthorizedKeys(sshPath, oldPath, execPath); err != nil {
+ fmt.Println(err)
+ os.Exit(1)
+ }
}
// Fix position in gogs-repositories.