File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
"crypto/sha1"
6
6
"encoding/hex"
7
7
"encoding/json"
8
+ "flag"
8
9
"fmt"
9
10
"io"
10
11
"net/http"
@@ -29,7 +30,12 @@ func main() {
29
30
}
30
31
31
32
func loadConfig () {
32
- file , err := os .Open ("config.json" )
33
+ // load flags
34
+ configPath := flag .String ("config" , "config.json" , "The path to the config file" )
35
+
36
+ flag .Parse ()
37
+
38
+ file , err := os .Open (* configPath )
33
39
if err != nil {
34
40
fmt .Printf ("Error opening config file: %v\n " , err )
35
41
os .Exit (1 )
@@ -66,7 +72,7 @@ func setDefaultsAndValidateConfig() {
66
72
func start () {
67
73
http .HandleFunc ("/" , HandleWebhook )
68
74
69
- fmt .Println ("\n \033 [30;46m LitePipe \033 [0m version 0.1.8 " )
75
+ fmt .Println ("\n \033 [30;46m LitePipe \033 [0m version 0.1.9 " )
70
76
fmt .Printf ("PID: %d\n " , os .Getpid ())
71
77
fmt .Printf ("Listening on port %d\n \n " , config .Port )
72
78
You can’t perform that action at this time.
0 commit comments