summaryrefslogtreecommitdiff
path: root/sand
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2026-09-10 09:35:06 +0100
committertslil <tslil@posteo.de>2026-09-10 09:36:22 +0100
commit30e3fd068433ee1f6feb28b524efce09a33e6f7e (patch)
tree9cd05ac5e024f2b707bfe1e0ac69d89480de46d6 /sand
parentc3f238acb1b49cb6782693a7781d325a6090d1ad (diff)
sand: accept command as second argument
Diffstat (limited to 'sand')
-rwxr-xr-xsand9
1 files changed, 7 insertions, 2 deletions
diff --git a/sand b/sand
index 1f3c64a..0073f2d 100755
--- a/sand
+++ b/sand
@@ -5,6 +5,11 @@ if [ -z "$1" ]; then
exit 1
fi;
+cmd="bash"
+if [ -n "$2" ]; then
+ cmd="$2"
+fi;
+
bwrap \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
@@ -31,7 +36,7 @@ bwrap \
--setenv USER $(whoami) \
--setenv SHELL /bin/bash \
--setenv TERM foot \
- --setenv PATH /home/$(whoami)/.local/bin:/home/$(whoami)/.local/share/npm/bin::/usr/local/sbin:/usr/local/bin:/usr/bin \
+ --setenv PATH /home/$(whoami)/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin \
--bind "$1" /home/$(whoami)/project/ \
--chdir /home/$(whoami)/project/ \
- bash
+ $cmd