2 Star 1 Fork 0

mrwhen / gone

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
npm.go 499 Bytes
一键复制 编辑 原始数据 按行查看 历史
哎呦-不错的猪公 提交于 2022-12-24 11:40 . fix: 修改module name
package command
import (
"log"
"os"
"os/exec"
"gitee.com/mrwhen/gone/framework/cobra"
)
// npm just run local go bin
var npmCommand = &cobra.Command{
Use: "npm",
Short: "运行 PATH/npm 的命令",
RunE: func(c *cobra.Command, args []string) error {
path, err := exec.LookPath("npm")
if err != nil {
log.Fatalln("hade npm: should install npm in your PATH")
}
cmd := exec.Command(path, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
return nil
},
}
Go
1
https://gitee.com/mrwhen/gone.git
git@gitee.com:mrwhen/gone.git
mrwhen
gone
gone
v0.0.1-alpha

搜索帮助