Skip to content

Commit 1c58c2c

Browse files
committed
fix(ci): run on windows
1 parent 1bd5ca4 commit 1c58c2c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/lib_run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
shell: pwsh
8484
run: |
8585
$logFile = Join-Path $PWD "output.log"
86+
$env:DEBUG_MODE = "1"
8687
$proc = Start-Process -FilePath ".\testbin.exe" -NoNewWindow -PassThru -RedirectStandardOutput "$logFile" -RedirectStandardError (Join-Path $PWD "stderr.log")
8788
$found = $false
8889
for ($i = 0; $i -lt 60; $i++) {

abineundo/console_windows.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ func init() {
7171
stdout := windows.Handle(os.Stdout.Fd())
7272
err = windows.GetConsoleMode(stdout, &mode)
7373
if err != nil {
74+
if debugMode {
75+
logrus.Warnf("调试模式下忽略控制台模式获取失败: %v", err)
76+
logrus.SetFormatter(&logFormat{hasColor: false})
77+
return
78+
}
7479
panic(err)
7580
}
7681

0 commit comments

Comments
 (0)