From 1d6f63972a371f6ecacd27ba1b3f42578cbbb95f Mon Sep 17 00:00:00 2001 From: Minho Date: Mon, 5 Jun 2017 12:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsqlite=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/command.go b/commands/command.go index d7cba257..fedb8293 100644 --- a/commands/command.go +++ b/commands/command.go @@ -54,6 +54,9 @@ func RegisterDataBase() { } } else if adapter == "sqlite3" { database := beego.AppConfig.String("db_database") + if strings.HasPrefix(database,"./") { + database = filepath.Join(WorkingDirectory,string(database[1:])) + } dbPath := filepath.Dir(database) os.MkdirAll(dbPath, 0777)