Temp timezone fix #11
2 changed files with 20 additions and 14 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
|
@ -108,6 +109,12 @@ func decrypt(encrypted string) (string, error) {
|
|||
func saveAccount(userID, username, password string) error {
|
||||
var accounts []Account
|
||||
|
||||
// Ensure the accounts directory exists
|
||||
accountsDir := filepath.Dir(accountsFile)
|
||||
if err := os.MkdirAll(accountsDir, 0755); err != nil {
|
||||
return fmt.Errorf("failed to create accounts directory: %v", err)
|
||||
}
|
||||
|
||||
// Load existing accounts if file exists
|
||||
if data, err := os.ReadFile(accountsFile); err == nil && len(data) > 0 {
|
||||
_ = json.Unmarshal(data, &accounts)
|
||||
|
|
|
|||
1
main.go
1
main.go
|
|
@ -101,7 +101,6 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
|
||||
godotenv.Load(".env")
|
||||
// Untis.Main() //starting API calls function| happens in schedule func
|
||||
// Run()
|
||||
|
|
|
|||
Loading…
Reference in a new issue