framework1/framework/command/npm_cmd.go

20 lines
388 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package command
import (
"github.com/Superdanda/hade/framework/cobra"
"log"
"os/exec"
)
var npmCommand = &cobra.Command{
Use: "npm",
Short: "运行npm命令要求npm必须安装",
RunE: func(c *cobra.Command, args []string) error {
path, err := exec.LookPath("npm")
if err != nil {
log.Fatalln("请在PATH路径中安装npm")
}
return runCommand(path, args)
},
}