Skip to content

Commit

Permalink
Update sinon.go
Browse files Browse the repository at this point in the history
  • Loading branch information
referefref committed Jul 2, 2024
1 parent e158173 commit e0a2358
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sinon.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ func main() {
log.Fatalf("Error loading config file: %v", err)
}

logger := logMultiWriter(config.General.LogFile)

Check failure on line 16 in sinon.go

View workflow job for this annotation

GitHub Actions / sinon release

undefined: logMultiWriter

if config.General.LogFile != "" {
logToFile(config.General.LogFile, "Starting interaction")
logger.Println("Starting interaction")
}

// Check if Chocolatey is installed
if err := checkAndInstallChocolatey(); err != nil {
logToFile(config.General.LogFile, "Error installing Chocolatey: "+err.Error())
log.Fatalf("Error installing Chocolatey: %v", err)
if err := checkAndInstallChocolatey(config); err != nil {

Check failure on line 23 in sinon.go

View workflow job for this annotation

GitHub Actions / sinon release

undefined: checkAndInstallChocolatey
logger.Fatalf("Error installing Chocolatey: %v", err)
}

// Perform initial setup
Expand Down Expand Up @@ -48,11 +49,9 @@ func main() {
duration = 60 // Default duration in minutes
}

// Keep the application running
select {
case <-time.After(time.Duration(duration) * time.Minute):
if config.General.LogFile != "" {
logToFile(config.General.LogFile, "Interaction completed")
}
time.Sleep(time.Duration(duration) * time.Minute)

if config.General.LogFile != "" {
logger.Println("Interaction completed")
}
}

0 comments on commit e0a2358

Please sign in to comment.