Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
dep: Fix -vendor-only path's invocation ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Jul 9, 2018
1 parent 0db8f69 commit 69991c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error {
params.TraceLogger = ctx.Err
}

if cmd.vendorOnly {
return cmd.runVendorOnly(ctx, args, p, sm, params)
}

statchan := make(chan map[string]verify.VendorStatus)
var lps []gps.LockedProject
if p.Lock != nil {
Expand Down Expand Up @@ -211,6 +207,10 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error {
statchan <- status
}(filepath.Join(p.AbsRoot, "vendor"), lps)

if cmd.vendorOnly {
return cmd.runVendorOnly(ctx, args, p, sm, params, statchan)
}

if fatal, err := checkErrors(params.RootPackageTree.Packages, p.Manifest.IgnoredPackages()); err != nil {
if fatal {
return err
Expand Down Expand Up @@ -348,7 +348,7 @@ func (cmd *ensureCommand) runVendorOnly(ctx *dep.Ctx, args []string, p *dep.Proj

// Pass the same lock as old and new so that the writer will observe no
// difference, and write out only ncessary vendor/ changes.
dw, err := dep.NewDeltaWriter(p.Lock, p.Lock, <-statchan, p.Manifest.PruneOptions, filepath.Join(p.AbsRoot, "vendor"), VendorAlways)
dw, err := dep.NewDeltaWriter(p.Lock, p.Lock, <-statchan, p.Manifest.PruneOptions, filepath.Join(p.AbsRoot, "vendor"), dep.VendorAlways)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion txn_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func (dw *DeltaWriter) PrintPreparedActions(output *log.Logger, verbose bool) er
lpd := dw.lockDiff.ProjectDeltas[pr]
v, id := projs[pr].Version(), projs[pr].Ident()
if reason == projectRemoved {
output.Printf("(%d/%d) Would have removed %s", i, tot, id, v, changeExplanation(reason, lpd))
output.Printf("(%d/%d) Would have removed %s", i, tot, id)
} else {
output.Printf("(%d/%d) Would hae written %s@%s: %s", i, tot, id, v, changeExplanation(reason, lpd))
}
Expand Down

0 comments on commit 69991c7

Please sign in to comment.