Skip to content

Commit

Permalink
文件不存在, 无法加载环境变量
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Mar 29, 2022
1 parent bcea0cd commit ca0fae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion console/commands/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package commands

import (
"bytes"
"fmt"
"github.com/ctfang/command"
"github.com/go-home-admin/toolset/console/commands/orm"
"github.com/joho/godotenv"
Expand Down Expand Up @@ -44,7 +45,7 @@ func (OrmCommand) Execute(input command.Input) {

err := godotenv.Load(root + "/.env")
if err != nil {
panic(err)
fmt.Println(root + "/.env" + "文件不存在, 无法加载环境变量")
}
fileContext, _ := os.ReadFile(file)
fileContext = SetEnv(fileContext)
Expand Down

0 comments on commit ca0fae5

Please sign in to comment.