From 6332a3e77700978ebedf0a80503d26ba1b0649fc Mon Sep 17 00:00:00 2001 From: Fabio Rapposelli Date: Fri, 1 Apr 2016 10:12:46 +0200 Subject: [PATCH] Add --yaml switch to exec command --- drone/exec.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drone/exec.go b/drone/exec.go index 94eb29a..d44f9c3 100644 --- a/drone/exec.go +++ b/drone/exec.go @@ -63,6 +63,11 @@ var ExecCmd = cli.Command{ Name: "E", Usage: "secrets from plaintext YAML of .drone.sec (use - for stdin)", }, + cli.StringFlag{ + Name: "yaml", + Usage: "path to .drone.yml file", + Value: ".drone.yml", + }, cli.BoolFlag{ Name: "trusted", Usage: "enable elevated privilege", @@ -96,6 +101,8 @@ var ExecCmd = cli.Command{ } func execCmd(c *cli.Context) error { + var ymlFile = c.String("yaml") + info := git.Info() cert, _ := ioutil.ReadFile(filepath.Join( @@ -116,7 +123,7 @@ func execCmd(c *cli.Context) error { println("") } - yml, err := ioutil.ReadFile(".drone.yml") + yml, err := ioutil.ReadFile(ymlFile) if err != nil { return err }