Giter VIP home page Giter VIP logo

gb-cobra's Introduction

gb-cobra

Plugin to http://getgb.io to allow easy running of the spf13/cobra generator wihin a gb project. The cobra generator is used to working with a $GOPATH.

Installation

go get github.com/kkeuning/gb-cobra/...

Pre-reqs

go get github.com/constabulary/gb/...
go get -v github.com/spf13/cobra/cobra

$GOPATH/bin should be in your $PATH, gb-cobra assumes the cobra executable can be found in $PATH.

This is based on Doug Clark's gb-run plug-in, the primary difference being that gb-run adds GB_PROJECT_DIR/vendor to the GOPATH, which is not allowable for the cobra tool.

Or from the shell, if PROJ_DIR is set to the value of GB_PROJECT_DIR from gb env (assume /Users/kkeuning/gb-projects/test-app), then:

gb-run cobra init $PROJ_DIR/src/newAppName

Would be the equivalent of executing:

env GOPATH=$PROJ_DIR:$PROJ_DIR/vendor cobra init $PROJ_DIR/src/newAppName

which results in:

Error: Cobra only supports project within $GOPATH

With a few minor changes to create a gb-cobra plug-in:

gb cobra init $PROJ_DIR/src/newAppName

Is the equivalent of executing:

env GOPATH=$PROJ_DIR cobra init $PROJ_DIR/src/newAppName

results in:

Your Cobra application is ready at
/Users/kkeuning/gb-projects/test-app/src/newAppName
Give it a try by going there and running `go run main.go`
Add commands to it by running `cobra add [cmdname]`

Of course, within a gb project you ill be running gb build, not go run main.go and gb cobra add [cmdname] rather than just cobra add [cmdname] as instructed.

It could be overkill to create a plug-in for this, but its a convenience.

gb-cobra's People

Contributors

kkeuning avatar

Stargazers

Jimmy Tang avatar N8 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.