mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-12 09:05:39 +00:00
25 lines
497 B
Go
25 lines
497 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package executor
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
"os"
|
|
)
|
|
|
|
func (e *Executor) Kill(execReq *InternalLogEntry) error {
|
|
return execReq.Process.Kill()
|
|
}
|
|
|
|
func wrapCommandInShell(ctx context.Context, finalParsedCommand string) *exec.Cmd {
|
|
winCodepage := os.Getenv("OT_WIN_FLAG_U")
|
|
|
|
if winCodepage == "0" {
|
|
return exec.CommandContext(ctx, "cmd", "/C", finalParsedCommand)
|
|
} else {
|
|
return exec.CommandContext(ctx, "cmd", "/u", "/C", finalParsedCommand)
|
|
}
|
|
}
|