forked from facebook/buck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve symlinks when executing buck on unix
Summary: If buck is checked out in $HOME/devtools/buck yet run via a symlink in /usr/bin it will not run, since we attempt to resolve "/usr/bin/../programs". Eagerly resolving symlinks before executing resolves this problem. Test Plan: /usr/bin/buck --help
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
#!/bin/sh | ||
exec python "$(dirname $0)"/../programs/buck.py "$@" | ||
|
||
# Resolve symlinks if necessary, otherwise madness will follow. | ||
# On a GNU system, we could use "-f" to follow all symlinks. BSD based | ||
# systems don't have this flag. *sigh* | ||
BUCK_PATH="`readlink $0`" | ||
if [ -z "$BUCK_PATH" ]; then | ||
BUCK_PATH="$0" | ||
fi | ||
|
||
exec python "$(dirname $BUCK_PATH)/../programs/buck.py" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#!/bin/sh | ||
|
||
BUCK_PATH="`readlink $0`" | ||
if [ -z "$BUCK_PATH" ]; then | ||
BUCK_PATH="$0" | ||
fi | ||
|
||
exec python "$(dirname $0)"/../programs/buckd.py "$@" |