Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for Linux #59

Merged
merged 13 commits into from
Jun 27, 2024
5 changes: 1 addition & 4 deletions cmd/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ func configureGlobalCmd(cmd *cobra.Command, args []string) error {
log.SetOutput(io.Discard)
}
} else {
defer func() {
_ = f.Close()
log.SetOutput(io.Discard) // no more logging after closing the log file
}()
stm32cubemx.LogFile = f
log.SetOutput(f)
}
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
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 @@ -31,5 +33,9 @@ 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.ReadCbuildYmlFile(inFile, "CubeMX", &cbuildParams)
err := stm32cubemx.ReadCbuildGenIdxYmlFile(inFile, "CubeMX", &cbuildParams)
if err != nil {
return err
}
Expand Down
Loading
Loading