1 Star 1 Fork 1

up-zero/gotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
exec_windows.go 484 Bytes
一键复制 编辑 原始数据 按行查看 历史
GetcharZp 提交于 2023-08-14 18:26 +08:00 . feat 带通知的运行命令
//go:build windows
package gotool
import "os/exec"
// ExecShell 运行shell命令或脚本
//
// shell: shell 命令或脚本
func ExecShell(shell string) error {
cmd := exec.Command("cmd", "/C", shell)
return execCmd(cmd, nil)
}
// ExecShellWithNotify 带通知的运行shell命令或脚本
//
// ch: 输出通道
// shell: shell 命令或脚本
func ExecShellWithNotify(ch chan string, shell string) error {
cmd := exec.Command("cmd", "/C", shell)
return execCmd(cmd, ch)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/up-zero/gotool.git
git@gitee.com:up-zero/gotool.git
up-zero
gotool
gotool
main

搜索帮助