-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (36 loc) · 947 Bytes
/
Copy pathmain.go
File metadata and controls
46 lines (36 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// main.go
package main
import (
"flag"
"os"
"path/filepath"
"barcelona-watch/api"
"barcelona-watch/global"
"barcelona-watch/utils"
"github.com/joho/godotenv"
)
// FOR SYSTEM
// func init() {
// err := godotenv.Load("/home/mohammad/Videos/go/Barcelona-watch/.env")
// utils.HandleErr("Error loading .env file", err)
// }
// FOR ACTION
func init() {
// Get the correct path to the .env file in GitHub Actions
envFile := filepath.Join(os.Getenv("GITHUB_WORKSPACE"), ".env")
err := godotenv.Load(envFile)
utils.HandleErr("Error loading .env file", err)
}
func flagParser() {
flag.StringVar(&global.ProxyURL, "proxy", "", "Proxy URL to use for sending Telegram messages")
flag.Parse()
}
func main() {
flagParser()
// Load the API key from .env
apiKey := os.Getenv("API_KEY")
// Check for the last finished match
api.CheckFinishedMatches(apiKey)
// Check for the next scheduled match
api.CheckScheduledMatches(apiKey)
}