Skip to content

windows 下执行 build plugin 命令失败 #14

@AlgerDu

Description

@AlgerDu

具体原因:文件夹路径存在空格,比如 C:\Program Files

myexec/cmd.go 文件内:

不知什么原因 RunShell 对命令又做了一层包装,感觉完全没有必要。

func RunShell(shellString string) (exitCode int, err error) { cmd := initShellExec(shellString)
可以尝试这样修改:
`
func RunCmdShell(cmd *exec.Cmd) (exitCode int, err error) {
logger.Info("exec shell string", "content", cmd.String())
}

func RunCommand(cmdName string, args ...string) error {

   // ...

if runtime.GOOS == "windows" {
	_, err := RunCmdShell(cmd)
	return err
}

_, err := RunShell(cmd.String())
return err

}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions