constabulary/gb

Vendor command only works if gb is in PATH

Opened this issue · 6 comments

I don't normally keep my Go bin directory in my PATH, so I tried to run gb vendor restore as ~/go/bin/gb vendor restore, and it fails in a rather confusing way:

$ ~/go/bin/gb vendor restore
FATAL: unknown command "vendor"
gb, a project based build tool for the Go programming language.

Usage:

        gb command [arguments]

The commands are:

        build       build a package
        doc         show documentation for a package or symbol
        env         print project environment variables
        generate    generate Go files by processing source
        info        info returns information about this project
        list        list the packages named by the importpaths
        test        test packages

Use "gb help [command]" for more information about a command.

Additional help topics:

        plugin      plugin information
        project     gb project layout

Use "gb help [topic]" for more information about that topic.

Oh, I see. Is there a reason gb-vendor can't work on its own instead of failing like this?

$ ~/go/bin/gb-vendor restore
FATAL: don't run this binary directly, it is meant to be run as 'gb vendor ...'

Alright, thanks for clarifying. Fine by me if you want to close the issue.

I have $HOME/go/bin in my $PATH.

I also have $GOPATH set to $HOME/go.

Yet I'm getting the same error. Any thoughts?