parent
feb8d098de
commit
76d2d72383
39
install.sh
39
install.sh
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# bash-it installer
|
# direct bash install command
|
||||||
cp "${HOME}/.bash_profile" "${HOME}/.bash_profile.bak"
|
# bash -c "$(curl -s https://raw.github.com/revans/bash-it/master/install.sh)"
|
||||||
if [ "$0" == "bash" ]; then
|
if [ "$0" == "bash" ]; then
|
||||||
BASH_IT="${HOME}/.bash_it"
|
BASH_IT="${HOME}/.bash_it"
|
||||||
[[ -d "${BASH_IT}" ]] && rm -rf "${BASH_IT}"
|
[[ -d "${BASH_IT}" ]] && rm -rf "${BASH_IT}"
|
||||||
|
|
@ -9,8 +9,10 @@ else
|
||||||
BASH_IT=$(cd ${0%/*} && echo ${PWD})
|
BASH_IT=$(cd ${0%/*} && echo ${PWD})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if were not in ~/.bash_it then make it so
|
||||||
[[ "${BASH_IT}" != "${HOME}/.bash_it" ]] && cp -Rf "${BASH_IT}" "${HOME}/.bash_it"
|
[[ "${BASH_IT}" != "${HOME}/.bash_it" ]] && cp -Rf "${BASH_IT}" "${HOME}/.bash_it"
|
||||||
|
|
||||||
|
# aggregated .bash_profile backups to prevent loss from overwriting previous backup
|
||||||
BASH_PROFILE_BAK="${HOME}/.bash_profile.bak"
|
BASH_PROFILE_BAK="${HOME}/.bash_profile.bak"
|
||||||
if [ -f "${BASH_PROFILE_BAK}" ]; then
|
if [ -f "${BASH_PROFILE_BAK}" ]; then
|
||||||
list=($(ls "${BASH_PROFILE_BAK}"*))
|
list=($(ls "${BASH_PROFILE_BAK}"*))
|
||||||
|
|
@ -24,6 +26,9 @@ fi
|
||||||
|
|
||||||
cp "${BASH_IT}/template/bash_profile.template.bash" "${HOME}/.bash_profile"
|
cp "${BASH_IT}/template/bash_profile.template.bash" "${HOME}/.bash_profile"
|
||||||
|
|
||||||
|
echo "Copied the template .bash_profile into ~/.bash_profile, edit this file to customize bash-it"
|
||||||
|
|
||||||
|
# to jekyll conf or not to jekyll conf
|
||||||
while true; do
|
while true; do
|
||||||
read -n 1 -p "Do you use Jekyll? (If you don't know what Jekyll is, answer 'n') [Y/N] " RESP
|
read -n 1 -p "Do you use Jekyll? (If you don't know what Jekyll is, answer 'n') [Y/N] " RESP
|
||||||
case ${RESP} in
|
case ${RESP} in
|
||||||
|
|
@ -198,6 +203,36 @@ for param in "$@"; do
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
# re-usable helper function to load some of type
|
||||||
|
# argument file_type to load some
|
||||||
|
function load_some() {
|
||||||
|
file_type="${1}"
|
||||||
|
for path in $(ls "${BASH_IT}/${file_type}/available/"[^_]*); do
|
||||||
|
if [ ! -d "${BASH_IT}/${file_type}/enabled" ]; then
|
||||||
|
mkdir "${BASH_IT}/${file_type}/enabled"
|
||||||
|
fi
|
||||||
|
file_name="${path##*/}"
|
||||||
|
while true; do
|
||||||
|
read -p "Would you like to enable the ${file_name%%.*}${file_type}? [Y/N] " RESP
|
||||||
|
case ${RESP} in
|
||||||
|
[yY])
|
||||||
|
ln -s "${path}" "${BASH_IT}/${file_type}/enabled"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Please choose y or n."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# to load all/some/none of each enhancement type
|
||||||
|
>>>>>>> 5473b27 (Added minimum comments)
|
||||||
for type in "aliases" "plugins" "completion"; do
|
for type in "aliases" "plugins" "completion"; do
|
||||||
while true; do
|
while true; do
|
||||||
prompt=("Enable ${type}: Would you like to enable all, some, or" \
|
prompt=("Enable ${type}: Would you like to enable all, some, or" \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue