gosrcdir

command module
v0.0.0-...-9882256 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2018 License: MIT Imports: 7 Imported by: 0

README

gosrcdir

Simple utility for figuring out the correct path to put a repo in.

It doesn't create anything, and it doesn't include the name of the repo itself. The idea is that you can pass its output to mkdir -p like so:

REPO="https://github.com/doozr/gosrcdir"
REPO_DIR=$(gosrcdir $REPO)
mkdir -p "$REPO_DIR"
cd "$REPO_DIR"
git clone "$REPO"

This will give you a nice, go-style directory tree using your GOPATH as the root, but for any Git repo. Not just ones supported by go get.

Run it like so:

$ gosrcdir <repo URL>

It supports standard format URLs, like this:

$ gosrcdir https://github.com/doozr/gosrcdir
/home/user/go/src/github.com/doozr

And the weird URL format Git uses, like this:

$ gosrcdir git@github.com:doozr/gosrcdir.git
/home/user/go/src/github.com/doozr

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL