Permalink
Browse files

pkgenv command to edit package set environments. Fixes #41.

  • Loading branch information...
1 parent 99abb6d commit ab0e9e7c25cb0508fcbae06447bd18ab39cc3098 Erik Aigner committed Nov 16, 2013
Showing with 37 additions and 0 deletions.
  1. +1 −0 bin/gvm
  2. +36 −0 scripts/pkgenv
View
@@ -51,6 +51,7 @@ Commands:
listall - list available versions
alias - manage go version aliases
pkgset - manage go packages sets
+ pkgenv - edit the environment for a package set
"
fi
fi
View
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+. $GVM_ROOT/scripts/functions
+
+function show_usage() {
+ echo "Usage: gvm pkgenv [packageset-name]"
+ echo
+ echo " -h, --help Display this message."
+ echo
+ echo "The [packageset-name] is optional."
+ echo
+}
+
+for i in $*; do
+ case $i in
+ -h|--help*)
+ show_usage
+ exit 0
+ ;;
+ *)
+ gvm_env="$i"
+ ;;
+ esac
+done
+
+if [ -z $gvm_go_name ]; then
+ display_fatal "current go version not managed by gvm"
+fi
+
+if [ ! -z $gvm_env ]; then
+ gvm_env="@$gvm_env"
+fi
+
+env_file=$GVM_ROOT/environments/$gvm_go_name$gvm_env
+
+vi $env_file

0 comments on commit ab0e9e7

Please sign in to comment.