mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Route TUI realtime audio through shared echo cancellation
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
exports_files(
|
||||
["ninja_wrapper.sh"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
real_ninja="${NINJA_REAL:?NINJA_REAL must point to the downloaded ninja binary}"
|
||||
|
||||
try_exec() {
|
||||
candidate_dir="$1"
|
||||
[ -n "${candidate_dir}" ] || return 1
|
||||
[ -d "${candidate_dir}" ] || return 1
|
||||
|
||||
staged_dir="$(mktemp -d "${candidate_dir%/}/codex-ninja.XXXXXX" 2>/dev/null)" || return 1
|
||||
staged_ninja="${staged_dir}/ninja"
|
||||
|
||||
if cp "${real_ninja}" "${staged_ninja}" 2>/dev/null \
|
||||
&& chmod +x "${staged_ninja}" 2>/dev/null \
|
||||
&& "${staged_ninja}" --version >/dev/null 2>&1; then
|
||||
exec "${staged_ninja}" "$@"
|
||||
fi
|
||||
|
||||
rm -rf "${staged_dir}"
|
||||
return 1
|
||||
}
|
||||
|
||||
for candidate_dir in "${CODEX_NINJA_TMPDIR:-}" /private/var/tmp /var/tmp "${TMPDIR:-}" /tmp "${HOME:-}"; do
|
||||
try_exec "${candidate_dir}"
|
||||
done
|
||||
|
||||
echo "codex ninja wrapper: unable to stage an executable Ninja binary" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user