From ee494ab9395cc42d0b05fa01ee6ae72649e0b1a0 Mon Sep 17 00:00:00 2001 From: Fabian Wickborn Date: Mon, 22 Feb 2016 21:03:07 +0100 Subject: [PATCH] Use relocated command folders in build.go and run_integration_tests.go The resulting command structure is almost compatible to that of that gb reference project (example-gsftp), as the subfolder for commands is 'cmds' instead of 'cmd'. --- build.go | 12 ++++++++---- run_integration_tests.go | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.go b/build.go index 2f3f3e5f0..d81b57dc7 100644 --- a/build.go +++ b/build.go @@ -329,13 +329,17 @@ func main() { } verbosePrintf("create GOPATH at %v\n", gopath) - if err = updateGopath(gopath, filepath.Join(root, "src"), ""); err != nil { - die("copying files from %v to %v failed: %v\n", root, gopath, err) + if err = updateGopath(gopath, filepath.Join(root, "src", "restic"), "restic"); err != nil { + die("copying files from %v/src/restic to %v/src/restic failed: %v\n", root, gopath, err) + } + + if err = updateGopath(gopath, filepath.Join(root, "src", "cmds"), "cmds"); err != nil { + die("copying files from %v/src/cmds to %v/src/restic/cmds failed: %v\n", root, gopath, err) } vendor := filepath.Join(root, "vendor", "src") if err = updateGopath(gopath, vendor, ""); err != nil { - die("copying files from %v to %v failed: %v\n", root, gopath, err) + die("copying files from %v to %v/src failed: %v\n", vendor, gopath, err) } defer func() { @@ -372,7 +376,7 @@ func main() { args := []string{ "-tags", strings.Join(buildTags, " "), "-ldflags", ldflags, - "-o", output, "restic/cmd/restic", + "-o", output, "cmds/restic", } err = build(filepath.Join(gopath, "src"), gopath, args...) diff --git a/run_integration_tests.go b/run_integration_tests.go index e9ab7cda2..519a6cd1f 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -171,7 +171,7 @@ func (env *TravisEnvironment) RunTests() { "-arch", strings.Join(env.goxArch, " "), "-tags", tags, "-output", "/tmp/{{.Dir}}_{{.OS}}_{{.Arch}}", - "restic/cmd/restic") + "cmds/restic") } } @@ -192,7 +192,7 @@ func (env *TravisEnvironment) RunTests() { } // run the tests and gather coverage information - runWithEnv(envWithGOPATH, "gotestcover", "-coverprofile", "all.cov", "restic/...") + runWithEnv(envWithGOPATH, "gotestcover", "-coverprofile", "all.cov", "cmds/...", "restic/...") runGofmt()