mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
A script to symlink Homebrew into /usr/local
This is a developer utility, to allow you to keep your git clone in eg. your home directory, but still have Homebrew installed to /usr/local. It is an optional utility having the whole checkout at /usr/local is the default and recommended solution.
This commit is contained in:
parent
58fe4cc2bf
commit
1333e910cf
22
Library/Contributions/selflink.sh
Executable file
22
Library/Contributions/selflink.sh
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user