Skip to content

Commit

Permalink
oop
Browse files Browse the repository at this point in the history
  • Loading branch information
mgwalker committed Sep 16, 2023
1 parent 0d1e63d commit 9602cc1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/integrity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const cpExec = require("child_process").exec;
const exec = async (cmd) =>
new Promise((resolve, reject) => {
cpExec(cmd, (err, stdout) => {
if (err) {
return reject(new Error(err));
}
return resolve(stdout);
});
const run = async (cmd) => {
const out = [];
await exec.exec(cmd, {
stdout: (data) => {
out.push(data.toString());
},
});
return out.join("");
};
const sleep = async (ms) =>
new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -46,7 +46,7 @@ jobs:
});
(async () => {
const hashData = await exec("find _site -type f -exec md5sum {} +");
const hashData = await run("find _site -type f -exec md5sum {} +");
const hashes = hashData
.trim()
.split("\n")
Expand All @@ -65,7 +65,7 @@ jobs:
on += 1;
const remoteHash = (
await exec(`curl -sL ${url} | md5sum | cut -d ' ' -f 1`)
await run(`curl -sL ${url} | md5sum | cut -d ' ' -f 1`)
).trim();
if (expectedHash !== remoteHash) {
mismatch.push({ expectedHash, remoteHash, url });
Expand Down

0 comments on commit 9602cc1

Please sign in to comment.