INNER CODE UNIT · TypeScript

remainingMs

NVIDIA/NemoClaw · .dsh/tools/check_changed_files_for_nul_bytes/index.ts:30

    const remainingMs = deadline - Date.now();
    if (remainingMs <= 0) throw new Error("Could not scan changed files");
    const result = await tools.bash({
      command:
        "set -o pipefail; if [ ! -f " +
        quote(file) +
        " ]; then exit 3; fi; LC_ALL=C od -An -v -t u1 -- " +
        quote(file) +
        " | awk '{ for (i = 1; i <= NF; i++) if ($i == 0) count++ } END { print count + 0 }'",
      workdir: input.workdir,
      description: "Count NUL bytes in changed file",
      timeoutMs: remainingMs,
    });
    if (result.kind !== "foreground") throw new Error("Could not scan changed files");
    if (result.exitCode === 3) continue;
    if (result.exitCode !== 0) throw new Error("Could not scan changed files");
    const countText = result.stdout.text.trim();
    if (!/^\d+$/.test(countText)) throw new Error("Could not scan changed files");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…