change pwd to project workspace

This commit is contained in:
Brad Rydzewski 2015-12-07 00:01:55 -08:00
parent 2c9e796c96
commit 7e97f3a391

View File

@ -23,6 +23,7 @@ type Params struct {
} }
func main() { func main() {
workspace := drone.Workspace{}
repo := drone.Repo{} repo := drone.Repo{}
build := drone.Build{} build := drone.Build{}
vargs := Params{} vargs := Params{}
@ -30,7 +31,7 @@ func main() {
plugin.Param("repo", &repo) plugin.Param("repo", &repo)
plugin.Param("build", &build) plugin.Param("build", &build)
plugin.Param("vargs", &vargs) plugin.Param("vargs", &vargs)
plugin.Param("workspace", &workspace)
plugin.MustParse() plugin.MustParse()
if build.Event != "tag" { if build.Event != "tag" {
@ -40,6 +41,10 @@ func main() {
return return
} }
if len(workspace.Path) != 0 {
os.Chdir(workspace.Path)
}
if len(vargs.BaseUrl) == 0 { if len(vargs.BaseUrl) == 0 {
vargs.BaseUrl = "https://api.github.com/" vargs.BaseUrl = "https://api.github.com/"
} else { } else {