fix: load yaml config file
This commit is contained in:
parent
8dc7bbc6d4
commit
26ce3260b9
|
@ -4,7 +4,7 @@ Tool to automatize your deploy based on file write changes
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
After some change is made in our listener file the script placed on path set on `.yaml` variable called **webhook_script_path** will be executed.
|
After some change is made in our listener file the script placed on path set on `.yaml` configuration falled placed on `./configs/app.yaml` variable called **webhook_script_path** will be executed.
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
||||||
|
|
9
main.go
9
main.go
|
@ -1,7 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
@ -18,13 +17,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
envFilePath := ""
|
config, err := config.LoadConfig("./configs/app.yaml")
|
||||||
if os.Getenv("ENV") != "prod" {
|
|
||||||
flag.StringVar(&envFilePath, ".env path", "/", "provide .env path file as an absolute path")
|
|
||||||
flag.Parse()
|
|
||||||
}
|
|
||||||
|
|
||||||
config, err := config.LoadConfig(envFilePath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue