File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
package commands
2
2
3
3
import (
4
+ "os"
5
+
4
6
"github.com/barelyhuman/alvu/pkg/alvu"
7
+ "github.com/joho/godotenv"
5
8
"github.com/urfave/cli/v2"
6
9
)
7
10
8
11
func Alvu (c * cli.Context ) (err error ) {
12
+ // Prepare Environment
13
+ envFilePath := c .String ("env" )
14
+ if _ , err := os .Stat (envFilePath ); err == nil {
15
+ godotenv .Load (envFilePath )
16
+ }
17
+
9
18
baseConfig := alvu.AlvuConfig {}
10
19
11
20
// Basics
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ func main() {
62
62
Usage : "Define the poll duration in seconds" ,
63
63
Value : 1000 ,
64
64
},
65
+ & cli.StringFlag {
66
+ Name : "env" ,
67
+ Usage : "Environment File to consider" ,
68
+ Value : ".env" ,
69
+ },
65
70
& cli.StringFlag {
66
71
Name : "port" ,
67
72
Usage : "port to use for serving the application" ,
You can’t perform that action at this time.
0 commit comments