From 9d045de220bba2da47675a1fb4510a0b940ec5c4 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sun, 9 Dec 2018 13:24:33 -0500 Subject: Allow overriding of the GOPATH more easily --- mkshrc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mkshrc b/mkshrc index b3e6be2..4483370 100644 --- a/mkshrc +++ b/mkshrc @@ -254,6 +254,15 @@ set_nocaps() { setxkbmap -option ctrl:nocaps setxkbmap -option shift:breaks_caps } +set_go() { + export GOPATH="${GOPATH:-$HOME/go}" + export PATH="$GOPATH/bin:$PATH" + + _gobin="/usr/local/go/bin" + if [ -e "$_gobin" ] ; then + export PATH="$_gobin:$PATH" + fi +} pkg_switch_branch() { _f="/etc/pkg/FreeBSD.conf" cp $_f ${_f}.orig @@ -506,13 +515,6 @@ MY_LANG="en_US.UTF-8" export EDITORS="ed vi vim " export PATH="$HOME/bin:$PATH" -export GOPATH="$HOME/go" -export PATH="$GOPATH/bin:$PATH" - -_gobin="/usr/local/go/bin" -if [ -e "$_gobin" ] ; then - export PATH="$_gobin:$PATH" -fi UPDATE_URL="https://www.rygel.us/etc/" VIM_GIT_URL="https://git.riedstra.us/mitch/vim-cfg.git" @@ -529,6 +531,7 @@ if [ -e $PRELOAD ] ; then . $PRELOAD fi +set_go set_pager set_editor set_lang $MY_LANG -- cgit v1.2.3