Skip to content

Commit

Permalink
fix(compute/hashsum): pass correct variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Oct 25, 2023
1 parent 21f0a53 commit 5d81128
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/commands/compute/hashsum.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ func (c *HashsumCommand) Exec(in io.Reader, out io.Writer) (err error) {
if !c.Globals.Flags.Quiet {
// FIXME: Remove `hashsum` subcommand before v11.0.0 is released.
text.Warning(out, "This command is deprecated. Use `fastly compute hash-files` instead.")
if c.Globals.Verbose() || c.SkipBuild {
text.Break(out)
}
}

// No point in building a package if the user provides a package path.
Expand All @@ -77,7 +74,9 @@ func (c *HashsumCommand) Exec(in io.Reader, out io.Writer) (err error) {
if err != nil {
return err
}
text.Break(out)
if !c.Globals.Flags.Quiet {
text.Break(out)
}
}

pkgPath := c.PackagePath
Expand Down Expand Up @@ -133,7 +132,7 @@ func (c *HashsumCommand) Exec(in io.Reader, out io.Writer) (err error) {
}
}

hashSum, err := getHashSum(c.PackagePath)
hashSum, err := getHashSum(pkgPath)
if err != nil {
return err
}
Expand All @@ -145,8 +144,10 @@ func (c *HashsumCommand) Exec(in io.Reader, out io.Writer) (err error) {
// Build constructs and executes the build logic.
func (c *HashsumCommand) Build(in io.Reader, out io.Writer) error {
output := out
if !c.Globals.Verbose() {
if !c.Globals.Verbose() && !c.metadataShow.WasSet {
output = io.Discard
} else {
text.Break(out)
}
if c.dir.WasSet {
c.buildCmd.Flags.Dir = c.dir.Value
Expand Down

0 comments on commit 5d81128

Please sign in to comment.