Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jspeed-meyers
Copy link
Contributor

  • Use go install, rather than go build
  • Use the go executable in the final command

Related to @rnjudge's issues with the current tutorial in issue #14

Use install, rather than build, and use executable
@jspeed-meyers jspeed-meyers mentioned this pull request Jan 12, 2023
@justinabrahms justinabrahms merged commit f10d97d into eBay:main Jan 12, 2023
To run `sbom-scorecard` and specify the output format as JSON, run:

```bash
go run cmd/sbom-scorecard/main.go score --outputFormat json examples/dropwizard.cyclonedx.json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am only able to run sbom-scorecard tool using this go run command, even after running the go install command above.

rose@rose-vm:~/ternenv/sbom-scorecard$ go install cmd/sbom-scorecard/main.go
# bin directory properly created
rose@rose-vm:~/ternenv/sbom-scorecard$ ls ~/go/
bin/ pkg/

# try to run using sbom-scorecard command doesn't work
rose@rose-vm:~/ternenv/sbom-scorecard$ sbom-scorecard --help
sbom-scorecard: command not found

# using go run does
rose@rose-vm:~/ternenv/sbom-scorecard$ go run cmd/sbom-scorecard/main.go --help
sbom-scorecard evaluates the quality of the SBOM

Usage:
  sbom-scorecard [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  score       score evaluates the SBOM being passed and outputs based on the composition and completion

Flags:
  -h, --help   help for sbom-scorecard

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, if I call sbom-scorecard with main instead of sbom-scorecard, it works....?

rose@rose-vm:~/ternenv/sbom-scorecard$ go install cmd/sbom-scorecard/main.go
rose@rose-vm:~/ternenv/sbom-scorecard$ sbom-scorecard
sbom-scorecard: command not found
rose@rose-vm:~/ternenv/sbom-scorecard$ main
sbom-scorecard evaluates the quality of the SBOM

Usage:
  sbom-scorecard [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  score       score evaluates the SBOM being passed and outputs based on the composition and completion

Flags:
  -h, --help   help for sbom-scorecard

Use "sbom-scorecard [command] --help" for more information about a command.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find. I'll fix up the docs and rearrange things so this works correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked here: #21

@justinabrahms
Copy link
Contributor

@rnjudge I'm guessing that the go/bin directory isn't on your path? Try:

export PATH=$PATH:$HOME/go/bin/

and see if it can find the sbom-scorecard binary then.

@rnjudge
Copy link

rnjudge commented Jan 12, 2023

@justinabrahms go/bin is in my path. does this look right?

rose@rose-vm:~/ternenv/sbom-scorecard$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/home/rose/go/bin

but still no luck with scorecard command

@justinabrahms
Copy link
Contributor

justinabrahms commented Jan 12, 2023

@rnjudge Can you try this one?

go install github.com/ebay/sbom-scorecard/cmd/sbom-scorecard@latest

That should put an sbom-scorecard binary in the right spot.

(and yes, that path looks great)

@rnjudge
Copy link

rnjudge commented Jan 13, 2023

@justinabrahms that did it -- Thank you! Suggest adding that to the tutorial :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants