MCPcopy Create free account
hub / github.com/catboost/catboost / downloadBinaryFile

Function downloadBinaryFile

catboost/node-package/build_scripts/download.ts:63–72  ·  view source on GitHub ↗
(targetDirPath: string, binary: BinaryFileData)

Source from the content-addressed store, hash-verified

61}
62
63export async function downloadBinaryFile(targetDirPath: string, binary: BinaryFileData): Promise<string> {
64 const targetFile = join(targetDirPath, binary.targetFile);
65 await downloadFile(binary.url, targetFile);
66 const actualHash = calculateFileHash(targetFile);
67 if (actualHash !== binary.sha256) {
68 throw new Error(`Expected hash ${binary.sha256}, but actual hash value is ${actualHash}`);
69 }
70
71 return targetFile;
72}

Callers 1

preparePlatformBinaryFunction · 0.90

Calls 3

downloadFileFunction · 0.85
calculateFileHashFunction · 0.85
joinFunction · 0.50

Tested by

no test coverage detected