Always setting BLACKBOX_HOME

This makes the beginning of all files the same and a little simpler.

`${0%/*}` turns "/home/user/repository/bin/blackbox_edit" into
"/home/user/repository/bin", exactly like basename but without eating a
process.

Because other scripts needed `$blackbox_home` I made this into a
standardard variable that's always available.

This also loads _stack_lib.sh always because _blackbox_common.sh
requires it.
This commit is contained in:
Tyler Akins
2015-06-16 13:21:51 -05:00
parent 33429b3ca6
commit 6de7cd99cb
16 changed files with 28 additions and 38 deletions

View File

@@ -4,8 +4,8 @@
# blackbox_whatsnew - show what has changed in the last commit for a given file
#
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "${blackbox_home}/_blackbox_common.sh"
set -e
source "${0%/*}/_blackbox_common.sh"
if [[ $# -ne 1 ]]
then
@@ -39,7 +39,7 @@ cat_commit()
git checkout $COMMIT $FILE
echo "[$COMMIT] $FILE"
echo "---------------------"
"${blackbox_home}/blackbox_cat" $FILE | sed '/========== PLAINFILE/,/========== EXTRACTING/d'
"${BLACKBOX_HOME}/blackbox_cat" $FILE | sed '/========== PLAINFILE/,/========== EXTRACTING/d'
}
CURR_CONTENT=`cat_commit $CURR_COMMIT`