Skip to content

Commit

Permalink
Changing arg for input directory to be SRC-DIR.
Browse files Browse the repository at this point in the history
* Fixing govet failures

[#150804022](https://www.pivotaltracker.com/story/show/150804022)

Signed-off-by: Tom Viehman <[email protected]>
  • Loading branch information
Shatarupa Nandi authored and tjvman committed Sep 7, 2017
1 parent ef6ce42 commit 694679e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ type VendorPackageOpts struct {

type VendorPackageArgs struct {
PackageName string `positional-arg-name:"PACKAGE"`
URL DirOrCWDArg `positional-arg-name:"URL" default:"."`
URL DirOrCWDArg `positional-arg-name:"SRC-DIR" default:"."`
}

type Sha1ifyReleaseOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2545,7 +2545,7 @@ var _ = Describe("Opts", func() {
Describe("URL", func() {
It("contains desired values", func() {
Expect(getStructTagForName("URL", opts)).To(Equal(
`positional-arg-name:"URL" default:"."`,
`positional-arg-name:"SRC-DIR" default:"."`,
))
})
})
Expand Down
7 changes: 3 additions & 4 deletions cmd/vendor_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ var _ = Describe("VendorPackageCmd", func() {

releaseDirFactory := func(dir DirOrCWDArg) boshreldir.ReleaseDir {
switch dir {
case DirOrCWDArg{"/src-dir"}:
case DirOrCWDArg{Path: "/src-dir"}:
return srcReleaseDir
case DirOrCWDArg{"/dst-dir"}:
case DirOrCWDArg{Path: "/dst-dir"}:
return dstReleaseDir
default:
panic("Unexpected release dir")
}
panic("Never called")
}

ui = &fakeui.FakeUI{}
Expand All @@ -53,7 +52,7 @@ var _ = Describe("VendorPackageCmd", func() {
opts = VendorPackageOpts{
Args: VendorPackageArgs{
PackageName: "pkg1-name",
URL: DirOrCWDArg{"/src-dir"},
URL: DirOrCWDArg{Path: "/src-dir"},
},
Directory: DirOrCWDArg{Path: "/dst-dir"},
}
Expand Down
2 changes: 1 addition & 1 deletion releasedir/fs_release_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (d FSReleaseDir) writeVendoredPackage(pkg *boshpkg.Package) error {

err := d.fs.RemoveAll(pkgDirPath)
if err != nil {
return bosherr.WrapErrorf(err, "Creating package '%s' dir", name)
return bosherr.WrapErrorf(err, "Removing package '%s' dir", name)
}

err = d.fs.MkdirAll(pkgDirPath, os.ModePerm)
Expand Down

0 comments on commit 694679e

Please sign in to comment.