From 551841b7898e05013622b3b8feef59c047601afa Mon Sep 17 00:00:00 2001 From: June Yi Date: Tue, 22 Sep 2020 22:42:18 +0900 Subject: [PATCH] Support exec plugin on Windows --- api/internal/plugins/execplugin/execplugin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/internal/plugins/execplugin/execplugin.go b/api/internal/plugins/execplugin/execplugin.go index 22b379eb5..eff0209f9 100644 --- a/api/internal/plugins/execplugin/execplugin.go +++ b/api/internal/plugins/execplugin/execplugin.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "os" "os/exec" + "runtime" "strings" "github.com/google/shlex" @@ -50,7 +51,9 @@ func (p *ExecPlugin) ErrIfNotExecutable() error { if err != nil { return err } - if f.Mode()&0111 == 0000 { + // In Windows, it is not possible to determine whether a + // file is executable through file mode. + if f.Mode()&0111 == 0000 && runtime.GOOS != "windows" { return fmt.Errorf("unexecutable plugin at: %s", p.path) } return nil