Skip to content

Commit e3c54eb

Browse files
committed
Use set -o pipefail on supporting shells (Bash)
1 parent 2e0467a commit e3c54eb

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

_wrapper_exe.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22
# sandbox-venv: Secure container sandbox venv wrapper (GENERATED CODE)
33
set -eu
4-
4+
# shellcheck disable=SC3040
5+
case "$(set -o)" in *pipefail*) set -o pipefail ;; esac
56
alias realpath='realpath --no-symlinks'
67
warn () { echo "sandbox-venv/wrapper: $*" >&2; }
78

_wrapper_pip.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# sandbox-venv: Secure container sandbox venv wrapper (GENERATED CODE)
33
# pip wrapper: Re-run sandbox-venv after every pip installation
44
set -u
5+
# shellcheck disable=SC3040
6+
case "$(set -o)" in *pipefail*) set -o pipefail ;; esac
57
alias realpath='realpath --no-symlinks'
68

79
venv="$(realpath "${0%/*}/..")"

sandbox-venv.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Also re‑wrap any new scripts post installation by pip etc.
55
# shellcheck disable=SC2317
66
set -eu
7+
# shellcheck disable=SC3040
8+
case "$(set -o)" in *pipefail*) set -o pipefail ;; esac
79

810
for arg; do case "$arg" in -h|-\?|--help) echo "Usage: ${0##*/} [VENV_DIR] [BWRAP_OPTS] # Dir defaults to .venv"; exit ;; esac; done
911

0 commit comments

Comments
 (0)