load .env
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/LazyBachelor/LazyPM/cmd/pm/tasks"
|
"github.com/LazyBachelor/LazyPM/cmd/pm/tasks"
|
||||||
@@ -12,10 +13,21 @@ import (
|
|||||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/web"
|
"github.com/LazyBachelor/LazyPM/pkg/web"
|
||||||
|
"github.com/joho/godotenv"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
err := godotenv.Load(".env")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("Error loading .env file")
|
||||||
|
}
|
||||||
|
|
||||||
|
if os.Getenv("DEV") == "True" {
|
||||||
|
survey.StartCmd.Flags().BoolVar(&survey.DevFlag, "dev", false, "Enable development mode, which skips database connection, submission, task intro and questionare")
|
||||||
|
}
|
||||||
|
|
||||||
task.RegisterInterface("tui", tui.New())
|
task.RegisterInterface("tui", tui.New())
|
||||||
task.RegisterInterface("web", web.New())
|
task.RegisterInterface("web", web.New())
|
||||||
task.RegisterInterface("repl", repl.New())
|
task.RegisterInterface("repl", repl.New())
|
||||||
|
|||||||
Reference in New Issue
Block a user