From 4fe42e20b41863557236271df37f760e5a44d859 Mon Sep 17 00:00:00 2001 From: Nathan LaFreniere Date: Fri, 13 Nov 2015 16:17:17 -0800 Subject: [PATCH] use the workspace like im supposed to --- main.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 0d13ef1..48de7e0 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strings" + "github.com/drone/drone-go/drone" "github.com/drone/drone-go/plugin" "launchpad.net/goamz/aws" "launchpad.net/goamz/s3" @@ -193,8 +194,10 @@ func (aws *AWS) Cleanup() error { func main() { vargs := PluginArgs{} + workspace := drone.Workspace{} plugin.Param("vargs", &vargs) + plugin.Param("workspace", &workspace) if err := plugin.Parse(); err != nil { fmt.Println(err) os.Exit(1) @@ -211,14 +214,7 @@ func main() { if len(vargs.Source) == 0 { vargs.Source = "." } - - wd, err := os.Getwd() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - vargs.Source = filepath.Join(wd, vargs.Source) + vargs.Source = filepath.Join(workspace.Path, vargs.Source) if strings.HasPrefix(vargs.Target, "/") { vargs.Target = vargs.Target[1:]