Merge pull request #589 from justin8/change-install-location
Allow for any install locationpull/593/head
commit
d8e16c36a2
|
|
@ -10,7 +10,7 @@ Bash it provides a solid framework for using, developing and maintaining shell s
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
1. Check a clone of this repo: `git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it`
|
1. Check a clone of this repo to a location of your choice, such as: `git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it`
|
||||||
2. Run `~/.bash_it/install.sh` (it automatically backs up your `~/.bash_profile` or `~/.bashrc`, depending on your OS)
|
2. Run `~/.bash_it/install.sh` (it automatically backs up your `~/.bash_profile` or `~/.bashrc`, depending on your OS)
|
||||||
3. Edit your modified config (`~/.bash_profile` or `~/.bashrc`) file in order to customize Bash it.
|
3. Edit your modified config (`~/.bash_profile` or `~/.bashrc`) file in order to customize Bash it.
|
||||||
4. Check out available aliases, completions and plugins and enable the ones you want to use (see the next section for more details).
|
4. Check out available aliases, completions and plugins and enable the ones you want to use (see the next section for more details).
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
BASH_IT="$HOME/.bash_it"
|
BASH_IT="$(dirname "$(readlink -f "$0")")"
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
darwin*)
|
||||||
|
|
@ -36,18 +36,19 @@ test -w "$HOME/$CONFIG_FILE" &&
|
||||||
cp -a "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.bak" &&
|
cp -a "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.bak" &&
|
||||||
echo -e "\033[0;32mYour original $CONFIG_FILE has been backed up to $CONFIG_FILE.bak\033[0m"
|
echo -e "\033[0;32mYour original $CONFIG_FILE has been backed up to $CONFIG_FILE.bak\033[0m"
|
||||||
|
|
||||||
cp "$HOME/.bash_it/template/bash_profile.template.bash" "$HOME/$CONFIG_FILE"
|
cp "$BASH_IT/template/bash_profile.template.bash" "$HOME/$CONFIG_FILE"
|
||||||
|
sed -i "s|{{BASH_IT}}|$BASH_IT|" "$HOME/$CONFIG_FILE"
|
||||||
|
|
||||||
echo -e "\033[0;32mCopied the template $CONFIG_FILE into ~/$CONFIG_FILE, edit this file to customize bash-it\033[0m"
|
echo -e "\033[0;32mCopied the template $CONFIG_FILE into ~/$CONFIG_FILE, edit this file to customize bash-it\033[0m"
|
||||||
|
|
||||||
function load_one() {
|
function load_one() {
|
||||||
file_type=$1
|
file_type=$1
|
||||||
file_to_enable=$2
|
file_to_enable=$2
|
||||||
[ ! -d "$BASH_IT/$file_type/enabled" ] && mkdir "$BASH_IT/${file_type}/enabled"
|
mkdir -p "$BASH_IT/${file_type}/enabled"
|
||||||
|
|
||||||
dest="${BASH_IT}/${file_type}/enabled/${file_to_enable}"
|
dest="${BASH_IT}/${file_type}/enabled/${file_to_enable}"
|
||||||
if [ ! -e "${dest}" ]; then
|
if [ ! -e "${dest}" ]; then
|
||||||
ln -s "../available/${file_to_enable}" "${dest}"
|
ln -sf "../available/${file_to_enable}" "${dest}"
|
||||||
else
|
else
|
||||||
echo "File ${dest} exists, skipping"
|
echo "File ${dest} exists, skipping"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Path to the bash it configuration
|
# Path to the bash it configuration
|
||||||
export BASH_IT="$HOME/.bash_it"
|
export BASH_IT="{{BASH_IT}}"
|
||||||
|
|
||||||
# Lock and Load a custom theme file
|
# Lock and Load a custom theme file
|
||||||
# location /.bash_it/themes/
|
# location /.bash_it/themes/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue