4 Commits

Author SHA1 Message Date
tal@whatexit.org
9f7792a629 Fix syntax error: blackbox_edit: line 12: conditional binary operator expected
Fixed #39
2015-01-26 13:45:44 -05:00
tlimoncelli@stackexchange.com
9634e2424a Fix if expression 2015-01-14 16:10:45 +00:00
Tom Limoncelli
2dd4c51635 Merge pull request #38 from rtkwgray/master
Allow blackbox to run without being in $PATH
2015-01-14 11:00:30 -05:00
Warren Gray
beefbfb912 - Fix blackbox commands so that they work when called with absolute paths.
- Fix confidence_test.sh so that it's not hardcoded to a specific dev environment path.
2015-01-13 14:42:58 -05:00
12 changed files with 27 additions and 15 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,11 +4,12 @@
# 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")
if [[! is_on_cryptlist "$param" ]] && [[! is_on_cryptlist "$unencrypted_file" ]] ; then
if ! is_on_cryptlist "$param" && ! is_on_cryptlist "$unencrypted_file" ; then
read -r -p "Encrypt file $param? (y/n) " ans
case "$ans" in
y* | Y*)

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