diff --git a/.gitignore b/.gitignore index 4747098..f7f589b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,5 @@ Temporary Items .apdisk tmp tmp.pdf -.env +*.env *templ.txt diff --git a/config/host.go b/config/host.go index 09d455d..4e00be8 100644 --- a/config/host.go +++ b/config/host.go @@ -48,6 +48,10 @@ func NewHost() *Host { Name: "Port", Price: 20.0, }, + { + Name: "Transport", + Price: 20.0, + }, { Name: "Taxes", Price: 1.5, diff --git a/go.mod b/go.mod index 2b6c6e2..3e9c359 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/rjNemo/rentease -go 1.22.0 +go 1.22.1 require ( github.com/a-h/templ v0.2.543 diff --git a/main.go b/main.go index 56ac286..c42d649 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "embed" + "flag" "log" "os" "strconv" @@ -19,10 +20,14 @@ import ( //go:embed assets var static embed.FS +var envFile = flag.String("env", ".env", "env file name") func init() { + flag.Parse() + if os.Getenv("ENV") != "PROD" { - err := godotenv.Load(".env") + log.Printf("Loading env file: %q", *envFile) + err := godotenv.Load(*envFile) if err != nil { log.Fatalln("Error loading .env file") }