summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst8
-rwxr-xr-xb4-wrapper.sh8
2 files changed, 12 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index b569e33..c85d4ff 100644
--- a/README.rst
+++ b/README.rst
@@ -23,11 +23,11 @@ python3 -m pip install --user --upgrade b4
Running from the checkout dir
-----------------------------
If you want to run from the checkout dir without installing the python package,
-just create the following wrapper command and put it in your path::
+you can use the b4-wrapper.sh script.
- #!/bin/bash
- B4DIR=$HOME/your/path/to/b4-git-repo
- PYTHONPATH=$B4DIR env python3 $B4DIR/b4/command.py $@
+```
+${git_dir}/b4-wrapper.sh --help
+```
Support
-------
diff --git a/b4-wrapper.sh b/b4-wrapper.sh
new file mode 100755
index 0000000..cafeee1
--- /dev/null
+++ b/b4-wrapper.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+#
+# Run b4 from a git checkout.
+#
+
+SCRIPT_TOP="${SCRIPT_TOP:-$(cd "${BASH_SOURCE%/*}" && pwd)}"
+
+exec env PYTHONPATH="${SCRIPT_TOP}" python3 "${SCRIPT_TOP}/b4/command.py" "${@}"