Skip to content

Commit

Permalink
wip: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed Jun 12, 2024
1 parent 0380bab commit cd1f860
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180340,12 +180340,16 @@ function main() {
version = setupEsyTarball;
checksum = setupEsyShaSum;
}
console.log("Fetching tarball from", tarballUrl);
const downloadedEsyNPMTarball = yield tool_cache.downloadTool(tarballUrl);
const checksumAlgo = "sha1";
const computedChecksum = yield computeChecksum(downloadedEsyNPMTarball, checksumAlgo);
if (computedChecksum !== checksum) {
throw new Error(`Downloaded by checksum failed. url: ${setupEsyTarball} downloadPath: ${downloadedEsyNPMTarball} checksum expected: ${checksum} checksum computed: ${computedChecksum} checksum algorithm: ${checksumAlgo}`);
}
else {
console.log("Checksum validation succeeded. Downloaded tarball's checksum is:", checksum);
}
const extractedEsyNPM = yield tool_cache.extractTar(downloadedEsyNPMTarball);
core.startGroup("Running postinstall");
const esyPackagePath = external_path_.join(extractedEsyNPM, "package");
Expand Down
6 changes: 6 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ async function main() {
version = setupEsyTarball;
checksum = setupEsyShaSum;
}
console.log("Fetching tarball from", tarballUrl);
const downloadedEsyNPMTarball = await toolCache.downloadTool(tarballUrl);
const checksumAlgo = "sha1";
const computedChecksum = await computeChecksum(
Expand All @@ -107,6 +108,11 @@ async function main() {
throw new Error(
`Downloaded by checksum failed. url: ${setupEsyTarball} downloadPath: ${downloadedEsyNPMTarball} checksum expected: ${checksum} checksum computed: ${computedChecksum} checksum algorithm: ${checksumAlgo}`
);
} else {
console.log(
"Checksum validation succeeded. Downloaded tarball's checksum is:",
checksum
);
}

const extractedEsyNPM = await toolCache.extractTar(
Expand Down

0 comments on commit cd1f860

Please sign in to comment.