]> arthur.barton.de Git - bup.git/blob - cmd/python-cmd.sh
Simplify bup startup process
[bup.git] / cmd / python-cmd.sh
1 #!/bin/sh
2
3 set -e
4
5 top="$(pwd)"
6 cmdpath="$0"
7 # loop because macos has no recursive resolution
8 while test -L "$cmdpath"; do
9     link="$(readlink "$cmdpath")"
10     cd "$(dirname "$cmdpath")"
11     cmdpath="$link"
12 done
13 script_home="$(cd "$(dirname "$cmdpath")" && pwd -P)"
14 cd "$top"
15
16 bup_libdir="$script_home/../lib"  # bup_libdir will be adjusted during install
17
18 export PYTHONPATH="$bup_libdir${PYTHONPATH:+:$PYTHONPATH}"
19 export BUP_RESOURCE_PATH="$bup_libdir"
20
21 # This last line will be replaced with 'exec some/python "$@"