From feb8d098de88f42ed45acf13794c5c77d565f390 Mon Sep 17 00:00:00 2001 From: nickl- Date: Fri, 7 Dec 2012 02:24:48 +0200 Subject: [PATCH] How about a direct install with bash, curl and github * Use curl to retrieve the raw install script from github * Execute payload directly with bash -c without requiring file write * Detect bash execution (as apposed to terminal or script file execution) and assume that this is a direct install * On direct install * * purge ~/.bash_it if present * * git clone repo to ~/.bash_it * * continue installation as normal --- install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index da62ad83..ea9d7013 100755 --- a/install.sh +++ b/install.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash # bash-it installer -BASH_IT=$(cd ${0%/*} && echo ${PWD}) -cd "${OLDPWD}" cp "${HOME}/.bash_profile" "${HOME}/.bash_profile.bak" +if [ "$0" == "bash" ]; then + BASH_IT="${HOME}/.bash_it" + [[ -d "${BASH_IT}" ]] && rm -rf "${BASH_IT}" + git clone http://github.com/revans/bash-it.git "${BASH_IT}" +else + BASH_IT=$(cd ${0%/*} && echo ${PWD}) +fi [[ "${BASH_IT}" != "${HOME}/.bash_it" ]] && cp -Rf "${BASH_IT}" "${HOME}/.bash_it"