Skip to content

Commit 999f7b9

Browse files
committed
chore: throwaway macOS probe for beats
1 parent 583bd91 commit 999f7b9

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎.github/workflows/dc-beats-probe.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
npm install -g hyperframes@0.9.16 >/dev/null 2>&1
2121
ffmpeg -v error -f lavfi -i "sine=frequency=90:duration=8" tone.wav
2222
export PATH="$HOME/stubs:$PATH" SPAWN_LOG="$HOME/spawn.log" NODE_OPTIONS="--require $GITHUB_WORKSPACE/.probe/spawnlog.cjs"
23-
hyperframes beats tone.wav --json; echo "exit=$?"
23+
hyperframes beats tone.wav --json || echo "exit=$?"
2424
echo "--- stub calls"; cat "$HOME/stub.log" 2>/dev/null || echo none
2525
echo "--- node spawns"; cat "$HOME/spawn.log" 2>/dev/null || echo none

‎.probe/spawnlog.cjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ const log = (name, file, args) =>
55
fs.appendFileSync(process.env.SPAWN_LOG, `${process.pid} ${name} ${file} ${JSON.stringify(args ?? [])}\n ${new Error().stack.split("\n").slice(2, 6).join("\n ")}\n`);
66
for (const name of ["spawn", "spawnSync", "execFile", "execFileSync", "exec", "execSync", "fork"]) {
77
const real = cp[name];
8-
cp[name] = function (file, args, ...rest) { log(name, file, Array.isArray(args) ? args : []); return real.call(this, file, args, ...rest); };
8+
const wrapped = function (file, args, ...rest) { log(name, file, Array.isArray(args) ? args : []); return real.call(this, file, args, ...rest); };
9+
const custom = require("node:util").promisify.custom;
10+
if (real[custom]) wrapped[custom] = (file, args, ...rest) => (log(name, file, Array.isArray(args) ? args : []), real[custom](file, args, ...rest));
11+
cp[name] = wrapped;
912
}

0 commit comments

Comments
 (0)