Merge pull request #38 from rtkwgray/master

Allow blackbox to run without being in $PATH
This commit is contained in:
Tom Limoncelli
2015-01-14 11:00:30 -05:00
12 changed files with 26 additions and 14 deletions

View File

@@ -9,8 +9,9 @@
#
set -e
. _blackbox_common.sh
. _stack_lib.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
source ${blackbox_home}/_stack_lib.sh
fail_if_not_in_repo

View File

@@ -4,7 +4,8 @@
# blackbox_cat.sh -- Decrypt a file, cat it, shred it
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
shreddable=0

View File

@@ -4,7 +4,8 @@
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
unencrypted_file=$(get_unencrypted_filename "$param")

View File

@@ -5,7 +5,8 @@
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
unencrypted_file=$(get_unencrypted_filename "$1")
encrypted_file=$(get_encrypted_filename "$1")

View File

@@ -5,7 +5,8 @@
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
unencrypted_file=$(get_unencrypted_filename "$param")

View File

@@ -9,7 +9,8 @@
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
_determine_vcs_base_and_type # Sets VCS_TYPE

View File

@@ -14,7 +14,8 @@
export PATH=/usr/bin:/bin:"$PATH"
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
if [[ "$1" == "" ]]; then
FILE_GROUP=""

View File

@@ -11,7 +11,8 @@
# TODO(tlim): Add the unencrypted file to .hgignore
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
_determine_vcs_base_and_type
unencrypted_file=$(get_unencrypted_filename "$1")

View File

@@ -10,8 +10,9 @@
#
set -e
. _blackbox_common.sh
. _stack_lib.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
source ${blackbox_home}/_stack_lib.sh
fail_if_not_in_repo

View File

@@ -16,7 +16,8 @@
# have been decrypted for editing, you will see an empty list.
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
change_to_root

View File

@@ -5,7 +5,8 @@
#
set -e
. _blackbox_common.sh
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${blackbox_home}/_blackbox_common.sh
if [[ -z $GPG_AGENT_INFO ]]; then
echo 'WARNING: You probably want to run gpg-agent as'

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
export PATH="$HOME/gitwork/blackbox/bin":/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../bin
export PATH=${blackbox_home}:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
. _stack_lib.sh