chiark / gitweb /
found
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Jul 2020 23:26:44 +0000 (00:26 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Jul 2020 23:26:44 +0000 (00:26 +0100)
scripts/x [new file with mode: 0755]
scripts/xr [new file with mode: 0755]

diff --git a/scripts/x b/scripts/x
new file mode 100755 (executable)
index 0000000..7349090
--- /dev/null
+++ b/scripts/x
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+exec xterm "$@" &
diff --git a/scripts/xr b/scripts/xr
new file mode 100755 (executable)
index 0000000..b92ce58
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+leaves=""
+while ! cd Build 2>/dev/null; do
+    cwd="$(pwd)"
+    leaf="${cwd##*/}"
+    if test -z "$leaf"; then echo >&2 'xr: no Build found'; break; fi
+    leaves="$leaf/$leaves"
+    cd ..
+done
+
+exec x -e \
+really -u rustcargo \
+env - PATH=/usr/local/bin:/usr/bin:/bin HOME=/home/rustcargo \
+      $(env | egrep '^LC_|^LANG=|^LANGUAGE=|^TERM=|^LESS=|^PAGER=') \
+bash --login -ec 'cd "$@"; exec bash' x "$(pwd)/$leaves"