chiark / gitweb /
found
[ian-dotfiles.git] / scripts / xr
1 #!/bin/sh
2 set -e
3 leaves=""
4 while ! cd Build 2>/dev/null; do
5     cwd="$(pwd)"
6     leaf="${cwd##*/}"
7     if test -z "$leaf"; then echo >&2 'xr: no Build found'; break; fi
8     leaves="$leaf/$leaves"
9     cd ..
10 done
11
12 exec x -e \
13 really -u rustcargo \
14 env - PATH=/usr/local/bin:/usr/bin:/bin HOME=/home/rustcargo \
15       $(env | egrep '^LC_|^LANG=|^LANGUAGE=|^TERM=|^LESS=|^PAGER=') \
16 bash --login -ec 'cd "$@"; exec bash' x "$(pwd)/$leaves"