From 7e97f3a3911b4f5060468a8c61a1af01a765bb61 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 7 Dec 2015 00:01:55 -0800 Subject: [PATCH] change pwd to project workspace --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c8443dc..855cae8 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ type Params struct { } func main() { + workspace := drone.Workspace{} repo := drone.Repo{} build := drone.Build{} vargs := Params{} @@ -30,7 +31,7 @@ func main() { plugin.Param("repo", &repo) plugin.Param("build", &build) plugin.Param("vargs", &vargs) - + plugin.Param("workspace", &workspace) plugin.MustParse() if build.Event != "tag" { @@ -40,6 +41,10 @@ func main() { return } + if len(workspace.Path) != 0 { + os.Chdir(workspace.Path) + } + if len(vargs.BaseUrl) == 0 { vargs.BaseUrl = "https://api.github.com/" } else {