INNER CODE UNIT · TypeScript
blobAt
NVIDIA/NemoClaw · .dsh/tools/carry_nemoclaw_cached_review_recommendations/index.ts:93
const blobAt = async (file, ref) => {
const encodedFile = file.split("/").map(encodeURIComponent).join("/");
const result = await tools.run_github_cli({
workdir: input.workdir,
args: [
"api",
`repos/${repo}/contents/${encodedFile}?ref=${encodeURIComponent(ref)}`,
"--method",
"GET",
"--jq",
".sha",
],
acceptedExitCodes: [0, 1],
timeoutMs: 30000,
});
const detail = `${result.stdout}\n${result.stderr}`;
if (result.code === 0) return { exists: true, sha: result.stdout.trim() };
if (/HTTP 404|Not Found/i.test(detail)) return { exists: false, sha: null };