Skip to content

Commit

Permalink
feat: basic env impl
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyhuman committed May 16, 2024
1 parent dbd599c commit 0816fd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions commands/root.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package commands

import (
"os"

"github.com/barelyhuman/alvu/pkg/alvu"
"github.com/joho/godotenv"
"github.com/urfave/cli/v2"
)

func Alvu(c *cli.Context) (err error) {
// Prepare Environment
envFilePath := c.String("env")
if _, err := os.Stat(envFilePath); err == nil {
godotenv.Load(envFilePath)
}

baseConfig := alvu.AlvuConfig{}

// Basics
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func main() {
Usage: "Define the poll duration in seconds",
Value: 1000,
},
&cli.StringFlag{
Name: "env",
Usage: "Environment File to consider",
Value: ".env",
},
&cli.StringFlag{
Name: "port",
Usage: "port to use for serving the application",
Expand Down

0 comments on commit 0816fd8

Please sign in to comment.