From 37d376502b4bf727f111a8e6e0f9844edf23972a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Dec 2016 19:49:09 -0500 Subject: [PATCH] ruby=>rbenv, python=>pyenv; add install+update scripts --- dev/{python => pyenv}/.config/flake8 | 0 dev/pyenv/aliases.zsh | 6 ++++++ dev/{python => pyenv}/env.zsh | 0 dev/pyenv/install | 8 ++++++++ dev/pyenv/update | 8 ++++++++ dev/python/aliases.zsh | 5 ----- dev/python/install | 5 ----- dev/{ruby => rbenv}/.irbrc | 0 dev/{ruby => rbenv}/.pryrc | 0 dev/{ruby => rbenv}/.rspec | 0 dev/{ruby => rbenv}/aliases.zsh | 0 dev/{ruby => rbenv}/env.zsh | 0 dev/rbenv/install | 9 +++++++++ dev/rbenv/update | 8 ++++++++ dev/ruby/install | 12 ------------ 15 files changed, 39 insertions(+), 22 deletions(-) rename dev/{python => pyenv}/.config/flake8 (100%) create mode 100644 dev/pyenv/aliases.zsh rename dev/{python => pyenv}/env.zsh (100%) create mode 100755 dev/pyenv/install create mode 100755 dev/pyenv/update delete mode 100644 dev/python/aliases.zsh delete mode 100755 dev/python/install rename dev/{ruby => rbenv}/.irbrc (100%) rename dev/{ruby => rbenv}/.pryrc (100%) rename dev/{ruby => rbenv}/.rspec (100%) rename dev/{ruby => rbenv}/aliases.zsh (100%) rename dev/{ruby => rbenv}/env.zsh (100%) create mode 100755 dev/rbenv/install create mode 100755 dev/rbenv/update delete mode 100755 dev/ruby/install diff --git a/dev/python/.config/flake8 b/dev/pyenv/.config/flake8 similarity index 100% rename from dev/python/.config/flake8 rename to dev/pyenv/.config/flake8 diff --git a/dev/pyenv/aliases.zsh b/dev/pyenv/aliases.zsh new file mode 100644 index 00000000..f2e007a8 --- /dev/null +++ b/dev/pyenv/aliases.zsh @@ -0,0 +1,6 @@ +alias py='python' +command -v python2 >/dev/null && alias py2='python2' +command -v python3 >/dev/null && alias py3='python3' + +alias pye='pyenv' +alias ipy='ipython' diff --git a/dev/python/env.zsh b/dev/pyenv/env.zsh similarity index 100% rename from dev/python/env.zsh rename to dev/pyenv/env.zsh diff --git a/dev/pyenv/install b/dev/pyenv/install new file mode 100755 index 00000000..97de08e0 --- /dev/null +++ b/dev/pyenv/install @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ -d "$HOME/.pyenv" ]]; then + >&2 echo "~/.pyenv already exists, can't install." + exit 1 +else + git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv +fi diff --git a/dev/pyenv/update b/dev/pyenv/update new file mode 100755 index 00000000..d2cc1384 --- /dev/null +++ b/dev/pyenv/update @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ -d $HOME/.pyenv ]]; then + cd $HOME/.pyenv && git pull + for plugin in $HOME/.pyenv/plugins/*/; do + cd "$plugin" && git pull + done +fi diff --git a/dev/python/aliases.zsh b/dev/python/aliases.zsh deleted file mode 100644 index 3b27188b..00000000 --- a/dev/python/aliases.zsh +++ /dev/null @@ -1,5 +0,0 @@ -alias py='python' -alias py2='python2' -alias py3='python3' -alias pye='pyenv' -alias ipy='ipython' diff --git a/dev/python/install b/dev/python/install deleted file mode 100755 index 8baf78f9..00000000 --- a/dev/python/install +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -if [[ ! -d "$HOME/.pyenv" ]]; then - git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv -fi diff --git a/dev/ruby/.irbrc b/dev/rbenv/.irbrc similarity index 100% rename from dev/ruby/.irbrc rename to dev/rbenv/.irbrc diff --git a/dev/ruby/.pryrc b/dev/rbenv/.pryrc similarity index 100% rename from dev/ruby/.pryrc rename to dev/rbenv/.pryrc diff --git a/dev/ruby/.rspec b/dev/rbenv/.rspec similarity index 100% rename from dev/ruby/.rspec rename to dev/rbenv/.rspec diff --git a/dev/ruby/aliases.zsh b/dev/rbenv/aliases.zsh similarity index 100% rename from dev/ruby/aliases.zsh rename to dev/rbenv/aliases.zsh diff --git a/dev/ruby/env.zsh b/dev/rbenv/env.zsh similarity index 100% rename from dev/ruby/env.zsh rename to dev/rbenv/env.zsh diff --git a/dev/rbenv/install b/dev/rbenv/install new file mode 100755 index 00000000..ef8a2f02 --- /dev/null +++ b/dev/rbenv/install @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ -d "$HOME/.rbenv" ]]; then + >&2 echo "~/.rbenv already exists, can't install." + exit 1 +else + git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv + git clone https://github.com/rbenv/ruby-build.git $HOME/.rbenv/plugins/ruby-build +fi diff --git a/dev/rbenv/update b/dev/rbenv/update new file mode 100755 index 00000000..18c6f946 --- /dev/null +++ b/dev/rbenv/update @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ -d "$HOME/.rbenv" ]]; then + cd $HOME/.rbenv && git pull + for plugin in $HOME/.rbenv/plugins/*/; do + cd "$plugin" && git pull + done +fi diff --git a/dev/ruby/install b/dev/ruby/install deleted file mode 100755 index 3f8472ba..00000000 --- a/dev/ruby/install +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -case "$OSTYPE" in - darwin*) - brew install rbenv - ;; - linux*) - git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv - cd $HOME/.rbenv && src/configure && make -C src - git clone https://github.com/rbenv/ruby-build.git $HOME/.rbenv/plugins/ruby-build - ;; -esac