Skip to content

Commit

Permalink
Fix macos sandbox script incorrectly assuming that getconf doesn't …
Browse files Browse the repository at this point in the history
…exist
  • Loading branch information
ElectreAAS committed Jan 12, 2024
1 parent 265fbcb commit 3dd6fca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/state/shellscripts/sandbox_exec.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This script is only used on macOS, where /bin/bash is both guaranteed to exist and
# This script is only used on macOS, where /bin/bash is both guaranteed to exist
# and to be for the native architecture, which is why /usr/bin/env bash is not used.
# See https://github.com/ocaml/opam/issues/5450
set -ue
Expand All @@ -20,10 +20,10 @@ add_mounts() {
}

if [ -z ${TMPDIR+x} ]; then
# Others applications obtain the per-user temporary
# Other applications obtain the per-user temporary
# directory differently; the latter should be made readable/writable
# too and getconf seems to be a robust way to get it
if [ -z /usr/bin/getconf ]; then
if command -v getconf > /dev/null ; then
TMPDIR=$(getconf DARWIN_USER_TEMP_DIR)
add_mounts rw "$TMPDIR"
export TMPDIR
Expand Down

0 comments on commit 3dd6fca

Please sign in to comment.