Skip to content

Instantly share code, notes, and snippets.

@ekristen
Last active August 29, 2015 14:15
Show Gist options
  • Save ekristen/84875c88ffd502f190cc to your computer and use it in GitHub Desktop.
Save ekristen/84875c88ffd502f190cc to your computer and use it in GitHub Desktop.
Patch to make blackbox installable via homebrew
diff --git a/bin/blackbox_addadmin b/bin/blackbox_addadmin
index 782d815..a26472f 100755
--- a/bin/blackbox_addadmin
+++ b/bin/blackbox_addadmin
@@ -9,7 +9,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
source ${blackbox_home}/_stack_lib.sh
diff --git a/bin/blackbox_cat b/bin/blackbox_cat
index 3dd81c4..ec96199 100755
--- a/bin/blackbox_cat
+++ b/bin/blackbox_cat
@@ -4,7 +4,7 @@
# blackbox_cat.sh -- Decrypt a file, cat it, shred it
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
diff --git a/bin/blackbox_edit b/bin/blackbox_edit
index ea733ac..7984ad2 100755
--- a/bin/blackbox_edit
+++ b/bin/blackbox_edit
@@ -4,7 +4,7 @@
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
diff --git a/bin/blackbox_edit_end b/bin/blackbox_edit_end
index 826b8d3..b3f0d97 100755
--- a/bin/blackbox_edit_end
+++ b/bin/blackbox_edit_end
@@ -5,7 +5,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
unencrypted_file=$(get_unencrypted_filename "$1")
diff --git a/bin/blackbox_edit_start b/bin/blackbox_edit_start
index 30eee58..fbc007b 100755
--- a/bin/blackbox_edit_start
+++ b/bin/blackbox_edit_start
@@ -5,7 +5,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
for param in """$@""" ; do
diff --git a/bin/blackbox_initialize b/bin/blackbox_initialize
index c8062b8..c319ef5 100755
--- a/bin/blackbox_initialize
+++ b/bin/blackbox_initialize
@@ -9,7 +9,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
_determine_vcs_base_and_type # Sets VCS_TYPE
diff --git a/bin/blackbox_postdeploy b/bin/blackbox_postdeploy
index 74152ee..66b2376 100755
--- a/bin/blackbox_postdeploy
+++ b/bin/blackbox_postdeploy
@@ -14,7 +14,7 @@
export PATH=/usr/bin:/bin:"$PATH"
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
if [[ "$1" == "" ]]; then
diff --git a/bin/blackbox_register_new_file b/bin/blackbox_register_new_file
index 8b91199..174c990 100755
--- a/bin/blackbox_register_new_file
+++ b/bin/blackbox_register_new_file
@@ -11,7 +11,7 @@
# TODO(tlim): Add the unencrypted file to .hgignore
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
_determine_vcs_base_and_type
diff --git a/bin/blackbox_removeadmin b/bin/blackbox_removeadmin
index 1863de8..3ead74c 100755
--- a/bin/blackbox_removeadmin
+++ b/bin/blackbox_removeadmin
@@ -10,7 +10,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
source ${blackbox_home}/_stack_lib.sh
diff --git a/bin/blackbox_shred_all_files b/bin/blackbox_shred_all_files
index b753089..dc53240 100755
--- a/bin/blackbox_shred_all_files
+++ b/bin/blackbox_shred_all_files
@@ -16,7 +16,7 @@
# have been decrypted for editing, you will see an empty list.
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
change_to_root
diff --git a/bin/blackbox_update_all_files b/bin/blackbox_update_all_files
index 4394f18..15145de 100755
--- a/bin/blackbox_update_all_files
+++ b/bin/blackbox_update_all_files
@@ -5,7 +5,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
source ${blackbox_home}/_blackbox_common.sh
if [[ -z $GPG_AGENT_INFO ]]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment