Skip to content

Commit

Permalink
remove top level await
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti committed Jun 7, 2024
1 parent 7a00bdd commit 61f477b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
16 changes: 9 additions & 7 deletions .github/check.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { readdirSync, readFileSync, existsSync } from "fs";
import { ExifTool } from "exiftool-vendored";

const exiftool = new ExifTool({ taskTimeoutMillis: 5000 });
(async () => {
const exiftool = new ExifTool({ taskTimeoutMillis: 5000 });

await checkDimensions("./images", 600, 600);
await checkDimensions("./print", 1200, 1200);
await checkDimensions("./images", 600, 600);
await checkDimensions("./print", 1200, 1200);

checkList("software.json");
checkList("groups.json");
checkList("software.json");
checkList("groups.json");

exiftool.end();
exiftool.end();
})();

// check list of entries in json file
function checkList(filename) {
Expand Down Expand Up @@ -56,7 +58,7 @@ async function checkDimensions(
for (const [index, path] of Object.entries(paths)) {
console.info(`Checking "${path}" (${+index + 1} of ${paths.length})`);

// extract dimensions
// extract metadata
const {
ImageWidth: width,
ImageHeight: height,
Expand Down
10 changes: 6 additions & 4 deletions .github/clean.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { readdirSync, unlinkSync } from "fs";
import { ExifTool } from "exiftool-vendored";

const exiftool = new ExifTool({ taskTimeoutMillis: 5000 });
(async () => {
const exiftool = new ExifTool({ taskTimeoutMillis: 5000 });

await stripMeta("./images");
await stripMeta("./print");
await stripMeta("./images");
await stripMeta("./print");

exiftool.end();
exiftool.end();
})();

// strip all metadata from all images in folder to ensure consistency
async function stripMeta(folder) {
Expand Down

0 comments on commit 61f477b

Please sign in to comment.