Code Monkey home page Code Monkey logo

lpk's Introduction

lpk

Build Status Go Report Card codecov GoDoc Go project version MIT Licensed

A small utility that looks for package in your GOPATH and returns the full path to the package directory.

The problem and the solution

All my projects are in GOPATH and I got tired of typing cd and the full path to the package/software directory.

So I created this little utility that looks in GOPATH and returns the full path to the project, so I can create an alias to change to the project directory and also can search by the project by name, etc.

Install

go get github.com/go-br/lpk

Example of use

Displays full path to the project

Search for the project in GOPATH and displays the full path type lpk project where project is the name of the package or software you are looking for. By default, lpk stops searching after it encounters the first occurrence.

lpk project 

To list all project occurrences use the parameter -list with "all" string

lpk -list=all project

This command will list all the project occurrences including those found in the vendor directly, to ignore the vendor add skipvendor to the -list parameter

lpk -list=all,skipvendor project

Tips

Changes to the project directory automatically

cd $(lpk project)

Set up an alias for the cd and jump straight to your project directory. Example, let's say you want to create an alias to jump directly to the project directory. Just change project by project name in your GOPATH

alias aliasname="cd $(lpk project)"

Another tip, if you are using macOS the following command creates an alias to open the Finder in the project directory. Remember to change the word project by the name of your project in GOPATH

alias aliasname="open $(lpk project)"

Contributing

  • Fork the repo on GitHub
  • Clone the project to your own machine
  • Create a branch with your modifications git checkout -b fantastic-feature.
  • Then commit your changes git commit -m 'Implementation of new fantastic feature'
  • Make a push to your branch git push origin fantastic-feature.
  • Submit a Pull Request so that we can review your changes

lpk's People

Contributors

crgimenes avatar felipeweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

felipeweb

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.