fixed .env loading

This commit is contained in:
Jannover5000r 2025-08-26 01:47:23 +02:00
parent 87887832c8
commit 65d88f8c27
2 changed files with 3 additions and 1 deletions

View file

@ -43,7 +43,7 @@ var (
var encryptionKey []byte var encryptionKey []byte
func init() { func init() {
godotenv.Load("/home/Jannik/Documents/Code/Go/Untis/Untis-Logger/.env") godotenv.Load(".env")
keyStr := os.Getenv("ENC_KEY") keyStr := os.Getenv("ENC_KEY")
if keyStr == "" { if keyStr == "" {
panic("ENC_KEY environment variable not set") panic("ENC_KEY environment variable not set")

View file

@ -34,6 +34,7 @@ type NamedTimetableEntry struct {
// init and main// // init and main//
func init() { func init() {
godotenv.Load(".env")
err := godotenv.Load() err := godotenv.Load()
if err != nil { if err != nil {
log.Printf("Error loading .env file: %v", err) log.Printf("Error loading .env file: %v", err)
@ -51,6 +52,7 @@ func init() {
} }
func main() { func main() {
godotenv.Load(".env")
//Untis.Main() //starting API calls function| happens in schedule func //Untis.Main() //starting API calls function| happens in schedule func
//Run() //Run()
//Starts logging the timetable for each new Lesson and logs changes //Starts logging the timetable for each new Lesson and logs changes