aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-12 23:14:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-12 23:56:20 +1200
commit4737f7e284946130d7e781454f2ed19c17fcdccf (patch)
treee7b68924061626de3dec64a44c97001be2d2a1c7
parentReformat README and fix a path or two (diff)
downloaddotfiles-4737f7e284946130d7e781454f2ed19c17fcdccf.tar.gz
dotfiles-4737f7e284946130d7e781454f2ed19c17fcdccf.zip
Update plenv and add pyenv config
-rw-r--r--Makefile6
-rw-r--r--plenv/shrc.d/plenv.sh1
-rw-r--r--pyenv/profile.d/pyenv.sh5
-rw-r--r--pyenv/shrc.d/pyenv.sh18
4 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 10d96388..cd646ea4 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,9 @@
install-newsboat \
install-perlcritic \
install-perltidy \
+ install-plenv \
install-psql \
+ install-pyenv \
install-readline \
install-sh \
install-subversion \
@@ -525,6 +527,10 @@ install-plenv: install-sh
install-psql:
cp -p -- psql/psqlrc $(HOME)/.psqlrc
+install-pyenv: install-sh
+ cp -p -- pyenv/profile.d/* $(HOME)/.profile.d
+ cp -p -- pyenv/shrc.d/* $(HOME)/.shrc.d
+
install-readline:
cp -p -- readline/inputrc $(HOME)/.inputrc
diff --git a/plenv/shrc.d/plenv.sh b/plenv/shrc.d/plenv.sh
index 6e03618e..5848fd5b 100644
--- a/plenv/shrc.d/plenv.sh
+++ b/plenv/shrc.d/plenv.sh
@@ -15,3 +15,4 @@ plenv() {
;;
esac
}
+plenv rehash
diff --git a/pyenv/profile.d/pyenv.sh b/pyenv/profile.d/pyenv.sh
new file mode 100644
index 00000000..296df3ac
--- /dev/null
+++ b/pyenv/profile.d/pyenv.sh
@@ -0,0 +1,5 @@
+# Define env vars for pyenv if it appears to be in use
+[ -d "$HOME"/.pyenv ] || return
+PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
+MANPATH=$HOME/.pyenv/versions/$(python -V|cut -d' ' -f2)/share/man:$MANPATH
+export MANPATH
diff --git a/pyenv/shrc.d/pyenv.sh b/pyenv/shrc.d/pyenv.sh
new file mode 100644
index 00000000..1c90f8f2
--- /dev/null
+++ b/pyenv/shrc.d/pyenv.sh
@@ -0,0 +1,18 @@
+# POSIX-compatible version of the pyenv Bash shell wrapper
+[ -d "$HOME"/.pyenv ] || return
+pyenv() {
+ case $1 in
+ rehash)
+ shift
+ eval "$(pyenv sh-rehash "$@")"
+ ;;
+ shell)
+ shift
+ eval "$(pyenv sh-shell "$@")"
+ ;;
+ *)
+ command pyenv "$@"
+ ;;
+ esac
+}
+pyenv rehash