Remove restrictions on directory for scm-breeze
Previously the script had to be installed to ~/.scm_breeze. Now it can live anywhere!
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
#locate the dir where this script is stored
|
||||||
|
scmbDir="$(dirname "$0")"
|
||||||
# This loads SCM Breeze into the shell session.
|
# This loads SCM Breeze into the shell session.
|
||||||
exec_string='[[ -s "$HOME/.scm_breeze/scm_breeze.sh" ]] && . "$HOME/.scm_breeze/scm_breeze.sh"'
|
exec_string='[[ -s "$scmbDir/scm_breeze.sh" ]] && . "$scmbDir/scm_breeze.sh"'
|
||||||
|
|
||||||
# Add line to bashrc and zshrc if not already present.
|
# Add line to bashrc and zshrc if not already present.
|
||||||
for rc in bashrc zshrc; do
|
for rc in bashrc zshrc; do
|
||||||
@@ -11,7 +14,7 @@ for rc in bashrc zshrc; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Load SCM Breeze update scripts
|
# Load SCM Breeze update scripts
|
||||||
. "$HOME/.scm_breeze/lib/scm_breeze.sh"
|
. "$scmbDir/lib/scm_breeze.sh"
|
||||||
# Create '~/.*.scmbrc' files from example files
|
# Create '~/.*.scmbrc' files from example files
|
||||||
_create_or_patch_scmbrc
|
_create_or_patch_scmbrc
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ _create_or_patch_scmbrc() {
|
|||||||
for scm in git; do
|
for scm in git; do
|
||||||
# Create file from example if it doesn't already exist
|
# Create file from example if it doesn't already exist
|
||||||
if ! [ -e "$HOME/.$scm.scmbrc" ]; then
|
if ! [ -e "$HOME/.$scm.scmbrc" ]; then
|
||||||
cp "$HOME/.scm_breeze/$scm.scmbrc.example" "$HOME/.$scm.scmbrc"
|
cp "$scmbDir/$scm.scmbrc.example" "$HOME/.$scm.scmbrc"
|
||||||
echo "== '~/.$scm.scmbrc' has been created. Please edit this file to change SCM Breeze settings for '$scm'."
|
echo "== '~/.$scm.scmbrc' has been created. Please edit this file to change SCM Breeze settings for '$scm'."
|
||||||
# If file exists, attempt to update it with any new settings
|
# If file exists, attempt to update it with any new settings
|
||||||
elif [ -n "$1" ]; then
|
elif [ -n "$1" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user