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

Commit

Permalink
Adding UX output to dep init
Browse files Browse the repository at this point in the history
  • Loading branch information
xmattstrongx committed Sep 16, 2017
1 parent d62440d commit 6e77029
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/dep/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
if ctx.Verbose {
ctx.Out.Println("Getting direct dependencies...")
}
pkgT, directDeps, err := getDirectDependencies(sm, p)
pkgT, directDeps, err := getDirectDependencies(sm, p, ctx)
if err != nil {
return err
}
Expand Down Expand Up @@ -226,7 +226,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
return nil
}

func getDirectDependencies(sm gps.SourceManager, p *dep.Project) (pkgtree.PackageTree, map[string]bool, error) {
func getDirectDependencies(sm gps.SourceManager, p *dep.Project, ctx *dep.Ctx) (pkgtree.PackageTree, map[string]bool, error) {
pkgT, err := pkgtree.ListPackages(p.ResolvedAbsRoot, string(p.ImportRoot))
if err != nil {
return pkgtree.PackageTree{}, nil, errors.Wrap(err, "gps.ListPackages")
Expand All @@ -239,6 +239,9 @@ func getDirectDependencies(sm gps.SourceManager, p *dep.Project) (pkgtree.Packag
if err != nil {
return pkgtree.PackageTree{}, nil, err
}
if !directDeps[string(pr)] {
ctx.Out.Printf("Cached %s ", string(pr))
}
directDeps[string(pr)] = true
}

Expand Down

0 comments on commit 6e77029

Please sign in to comment.