Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Filling in some docs for the `linkthis` command

as well as some minor space/tab touchup.
  • Loading branch information...
commit 224a8deb25e8753daa585693ab023b4a35ab9beb 1 parent 77f7e03
Dan Buch authored
Showing with 19 additions and 7 deletions.
  1. +1 −0  README
  2. +1 −0  README.md
  3. +1 −0  bin/gvm
  4. +16 −7 scripts/linkthis
View
1  README
@@ -10,6 +10,7 @@ Features
* Manage GOPATHs with `gvm pkgset [create/use/delete] [name]`. Use `--local` as `name` to manage repository under local path (`/path/to/repo/.gvm_local`).
* List latest release tags with `gvm listall`. Use `--all` to list weekly as well.
* Cache a clean copy of the latest Go source for multiple version installs.
+* Link project directories into GOPATH
Background
==========
View
1  README.md
@@ -10,6 +10,7 @@ Features
* Manage GOPATHs with `gvm pkgset [create/use/delete] [name]`. Use `--local` as `name` to manage repository under local path (`/path/to/repo/.gvm_local`).
* List latest release tags with `gvm listall`. Use `--all` to list weekly as well.
* Cache a clean copy of the latest Go source for multiple version installs.
+* Link project directories into GOPATH
Background
==========
View
1  bin/gvm
@@ -46,6 +46,7 @@ Commands:
install - install go versions
uninstall - uninstall go versions
cross - install go cross compilers
+ linkthis - link this directory into GOPATH
list - list installed go versions
listall - list available versions
alias - manage go version aliases
View
23 scripts/linkthis
@@ -2,12 +2,18 @@
. $GVM_ROOT/scripts/functions
function show_usage() {
- echo "Usage: gvm linkthis <package-name> [options]"
- echo " -h, --help Display this message."
+ echo "Usage: gvm linkthis [package-name] [options]"
+ echo " -h, --help Display this message."
+ echo
+ echo "If the [package-name] is provided, it will be used in the path based"
+ echo "at \${GOPATH%%:*}/src, e.g.:"
+ echo
+ echo " gvm linkthis github.com/moovweb/gpkg"
+ echo
+ echo "If omitted, the [package-name] will be the basename of the current"
+ echo "directory, e.g. '$package_name_basename'."
}
-package_name="$(basename "$PWD")"
-
function read_command_line() {
for i in $*; do
case $i in
@@ -20,13 +26,16 @@ function read_command_line() {
show_usage
exit 65 # Bad arguments
;;
- *)
- package_name="$i"
- ;;
+ *)
+ package_name="$i"
+ ;;
esac
done
}
+package_name="$(basename "$PWD")"
+package_name_basename="$package_name"
+
read_command_line "$@"
target="${GOPATH%%:*}/src/$package_name"
Please sign in to comment.
Something went wrong with that request. Please try again.