Skip to content

Commit

Permalink
implement #2241
Browse files Browse the repository at this point in the history
- update `install.sh` & `uninstall.sh`
- update `README.md`

Signed-off-by: Max Kovgan <[email protected]>
  • Loading branch information
mvk committed Feb 26, 2024
1 parent d985e4c commit 319d65f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ That's it! :smiley:
You can check out more components of Bash-it, and customize it to your desire.
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).

### custom configuration file location

By default the instller modifies/creates the actual ``~/.bashrc`` is updated.
If this is undesirable, you can create another file, by run the installer:
```bash
BASH_IT_CONFIG_FILE=path/to/my/custom/location.bash ~/.bash_it/install.sh
```

## Contributing

Expand Down
7 changes: 7 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ case $OSTYPE in
;;
esac

# overriding CONFIG_FILE:
CONFIG_FILE="${BASH_IT_CONFIG_FILE:-"${CONFIG_FILE}"}"
# create subdir if CONFIG_FILE has subdirectory components
if [[ "${CONFIG_FILE%/*}" != "${CONFIG_FILE}" ]]; then
mkdir -p "${HOME}/${CONFIG_FILE%/*}"
fi

BACKUP_FILE=$CONFIG_FILE.bak
echo "Installing bash-it"
if [[ -z "${no_modify_config}" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ case $OSTYPE in
;;
esac

# overriding CONFIG_FILE:
CONFIG_FILE="${BASH_IT_CONFIG_FILE:-"${CONFIG_FILE}"}"

BACKUP_FILE=$CONFIG_FILE.bak

if [ ! -e "$HOME/$BACKUP_FILE" ]; then
Expand Down

0 comments on commit 319d65f

Please sign in to comment.