sonatype-nexus-community / nancy

A tool to check for vulnerabilities in your Golang dependencies, powered by Sonatype OSS Index
Apache License 2.0
549 stars 76 forks source link

Fix --version command logic #184

Closed bhamail closed 3 years ago

bhamail commented 3 years ago

Latest release (v1.0.0) does not appear to be including the version correctly, at least in the brew flavor. Shows version as development.

$ brew upgrade nancy
...
$ which nancy
/Users/bhamail/go/bin/nancy
$ nancy --version
nancy version development

cc @bhamail / @DarthHater

DarthHater commented 3 years ago

Does not happen for me locally:

 ~/c/g/s/auditjs   $  brew upgrade nancy                                                                            10.1s  Thu Aug 27 21:24:42 2020
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (sonatype-nexus-community/nancy-tap and homebrew/core).
==> New Formulae
borgbackup               cli11                    localstack               numcpp                   protoc-gen-gogo          usb.ids
castget                  go@1.14                  mariadb@10.4             parallel-hashmap         protoc-gen-gogofaster    volk
cdktf                    inja                     mhonarc                  podman                   sleef                    wownero
==> Updated Formulae
Updated 547 formulae.

==> Upgrading 1 outdated package:
sonatype-nexus-community/nancy-tap/nancy 0.3.1 -> 1.0.0
==> Upgrading sonatype-nexus-community/nancy-tap/nancy 0.3.1 -> 1.0.0 
==> Downloading https://github.com/sonatype-nexus-community/nancy/releases/download/v1.0.0/nancy-darwin.amd64-v1.0.0.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/168600026/87fe4280-e84b-11ea-929e-67a1f1e7374c?X-Amz-Algorithm=AWS
######################################################################## 100.0%
🍺  /usr/local/Cellar/nancy/1.0.0: 5 files, 15.9MB, built in 2 seconds
Removing: /usr/local/Cellar/nancy/0.3.1... (5 files, 13.5MB)
Removing: /Users/darthhater/Library/Caches/Homebrew/nancy--0.3.1.tar.gz... (5.1MB)
 ~/c/g/s/auditjs   $  which nancy                                                                                   29.4s  Thu Aug 27 21:25:17 2020
/usr/local/bin/nancy
 ~/c/g/s/auditjs   $  nancy --version                                                                                       Thu Aug 27 21:25:31 2020
nancy version 1.0.0

Your which nancy looks a tad bit suspect, compared to mine.

zendern commented 3 years ago

Yah I second @DarthHater .... I like pls like you are using your local build version and not whatever brew installed. Probably a PATH ordering problem if I had to guess.

bhamail commented 3 years ago

Thanks for sanity checking me! (And sorry for the noise). Yes, it appears I had some leftovers from a prior go install. Was fixed by one or more of: go clean -i , brew remove nancy, brew install nancy, close and reopen shell, stand on left foot, face west, boom:

$ nancy --version
nancy version 1.0.0