aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/selflink.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/Library/Contributions/selflink.sh b/Library/Contributions/selflink.sh
new file mode 100755
index 000000000..285af4f86
--- /dev/null
+++ b/Library/Contributions/selflink.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+mode=$1
+if [[ -z $mode ]]; then
+ mode="install"
+fi
+
+source_base=`pwd`
+
+if [[ $mode == install ]]; then
+ ln -s "$source_base/bin/brew" "/usr/local/bin/brew";
+ ln -s "$source_base/Library" "/usr/local/Library";
+ ln -s "$source_base/Cellar" "/usr/local/Cellar";
+elif [[ $mode == undo ]]; then
+ rm "/usr/local/bin/brew"
+ rm "/usr/local/Library"
+ rm "/usr/local/Cellar"
+else
+ echo "Unknown command: $mode";
+ echo "\tselflink.sh [install] >> symlinks to /usr/local"
+ echo "\tselflink.sh undo >> removes symlinks from /usr/local"
+fi