Skip to content

Commit

Permalink
Revert "changes for Linux (#59)"
Browse files Browse the repository at this point in the history
This reverts commit 362be2c.
  • Loading branch information
jkrech authored Jun 28, 2024
1 parent 362be2c commit 22517a6
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 161 deletions.
5 changes: 4 additions & 1 deletion cmd/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ func configureGlobalCmd(cmd *cobra.Command, args []string) error {
log.SetOutput(io.Discard)
}
} else {
stm32cubemx.LogFile = f
defer func() {
_ = f.Close()
log.SetOutput(io.Discard) // no more logging after closing the log file
}()
log.SetOutput(f)
}
}
Expand Down
6 changes: 0 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
package main

import (
"io"
"os"
"time"

"github.com/open-cmsis-pack/generator-bridge/cmd/commands"
stm32cubemx "github.com/open-cmsis-pack/generator-bridge/internal/stm32CubeMX"
"github.com/open-cmsis-pack/generator-bridge/internal/utils"
log "github.com/sirupsen/logrus"
)
Expand All @@ -33,9 +31,5 @@ func main() {
}

log.Debugf("Took %v", time.Since(start))
if stm32cubemx.LogFile != nil {
_ = stm32cubemx.LogFile.Close()
}
log.SetOutput((io.Discard))
utils.StopSignalWatcher()
}
2 changes: 1 addition & 1 deletion internal/readFile/readFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Process(inFile, inFile2, outPath string) error {
params[0].Device = "Test Device"
}

err := stm32cubemx.ReadCbuildGenIdxYmlFile(inFile, "CubeMX", &cbuildParams)
err := stm32cubemx.ReadCbuildYmlFile(inFile, "CubeMX", &cbuildParams)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 22517a6

Please sign in to comment.