0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 12:32:49 +01:00
This commit is contained in:
Unknown 2014-03-11 22:38:33 -04:00
parent 0b5f6b176f
commit caf05599df

View file

@ -7,7 +7,9 @@ package models
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"github.com/Unknwon/com"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/lunny/xorm" "github.com/lunny/xorm"
@ -71,6 +73,21 @@ func setEngine() {
orm.ShowSQL = true orm.ShowSQL = true
RepoRootPath = base.Cfg.MustValue("repository", "ROOT") RepoRootPath = base.Cfg.MustValue("repository", "ROOT")
if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil {
fmt.Printf("models.init -> fail to create RepoRootPath(%s): %v\n", RepoRootPath, err)
os.Exit(2)
}
homeDir, err := com.HomeDir()
if err != nil {
fmt.Printf("models.init -> fail to get homeDir: %v\n", err)
os.Exit(2)
}
sshPath := filepath.Join(homeDir, ".ssh")
if err = os.MkdirAll(sshPath, os.ModePerm); err != nil {
fmt.Printf("models.init -> fail to create sshPath(%s): %v\n", sshPath, err)
os.Exit(2)
}
} }
func init() { func init() {