Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/gvm
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 36 additions & 0 deletions scripts/pkgenv
Original file line number Diff line number Diff line change
@@ -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