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
pull/174/head
nickl- 2012-12-07 02:24:48 +02:00
parent 061cca5304
commit feb8d098de
1 changed files with 7 additions and 2 deletions

View File

@ -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"