diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-24 08:41:33 +0100 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-24 10:26:35 -0400 |
commit | b6ada31e46a9345ee69ad8a807cd406a8f8897f7 (patch) | |
tree | 590ab2b8ce9064538f1c530dd813b19309b6904f | |
parent | d7dd67071649bc0a70041640c4ffac5c33112f38 (diff) | |
download | b4-b6ada31e46a9345ee69ad8a807cd406a8f8897f7.tar.gz |
b4: allow b4.sh to be symlinked to
Change b4.sh to handle being symlinked to in order to find out where it
"lives".
This allows me to have a symlink in my local ~/bin/ called b4 that links
to the git repo's b4.sh and have everything work properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | b4.sh | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3,6 +3,7 @@ # Run b4 from a git checkout. # -SCRIPT_TOP="${SCRIPT_TOP:-$(cd "${BASH_SOURCE%/*}" && pwd)}" +REAL_SCRIPT=$(realpath -e ${BASH_SOURCE[0]}) +SCRIPT_TOP="${SCRIPT_TOP:-$(dirname ${REAL_SCRIPT})}" exec env PYTHONPATH="${SCRIPT_TOP}" python3 "${SCRIPT_TOP}/b4/command.py" "${@}" |