-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbw-opencode
More file actions
executable file
·39 lines (35 loc) · 1.1 KB
/
bw-opencode
File metadata and controls
executable file
·39 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -eu
opencode_bin=$(which opencode)
host_cargo_home="${CARGO_HOME:-$HOME/.cargo/}"
host_rustup_home="${RUSTUP_HOME:-$HOME/.rustup}"
host_npm_local_home="${NPM_LOCAL_HOME:-$HOME/.npm-packages}"
#--unshare-all \
bwrap \
--unshare-pid \
--unshare-uts \
--unshare-ipc \
--share-net \
--new-session \
--die-with-parent \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
--ro-bind-try /lib64 /lib64 \
--ro-bind /bin /bin \
--ro-bind /etc /etc \
--ro-bind /run /run \
--tmpfs /tmp \
--dev /dev \
--proc /proc \
--bind "$HOME/.config/opencode" "$HOME/.config/opencode" \
--bind "$HOME/.local/share/opencode" "$HOME/.local/share/opencode" \
--bind "$HOME/.local/state/opencode" "$HOME/.local/state/opencode" \
--bind "$HOME/.cache/opencode" "$HOME/.cache/opencode" \
--ro-bind "$host_rustup_home" "$host_rustup_home" \
--bind "$host_cargo_home" "$host_cargo_home" \
--ro-bind "$host_npm_local_home" "$host_npm_local_home" \
--ro-bind "$SHELL" "$SHELL" \
--setenv SHELL "$SHELL" \
--setenv EDITOR "vim" \
--bind "$PWD" "$PWD" \
"$opencode_bin" "$@"