From b458f0cacd7c0e939bc57be79656a36ab628fb21 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Mon, 2 Sep 2024 23:34:57 +0200 Subject: [PATCH 1/2] fix: add missing await keywords for async functions Ensure proper handling of asynchronous file operations by adding missing `await` keywords. This prevents potential issues with incorrect execution order and ensures that file compression happens as intended. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 5ec84da..85e080b 100644 --- a/src/index.js +++ b/src/index.js @@ -71,8 +71,8 @@ import { hideBin } from 'yargs/helpers' // Search for staged files if(argv.staged){ - sgf('A', async function(err, results){ - if(err){ + await sgf('A', async function (err, results) { + if (err) { return console.error(err) } @@ -80,10 +80,10 @@ import { hideBin } from 'yargs/helpers' .map(result => result.filename) .filter(filename => files.includes(filename)) - compress(compressionFiles, argv.dry) + await compress(compressionFiles, argv.dry) }) } else { - compress(compressionFiles, argv.dry) + await compress(compressionFiles, argv.dry) } })() \ No newline at end of file From 8be430e9537e80578845b122d05735dfe327faff Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Mon, 2 Sep 2024 23:35:05 +0200 Subject: [PATCH 2/2] fix: bump version to 3.3.4 Updated package.json and package-lock.json to ensure version consistency across the project. This update addresses minor fixes and improvements. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1187c5c..91c62d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@j9t/imagemin-guard", - "version": "3.3.3", + "version": "3.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@j9t/imagemin-guard", - "version": "3.3.3", + "version": "3.3.4", "license": "Apache-2.0", "dependencies": { "chalk": "^5.3.0", diff --git a/package.json b/package.json index 5828402..0b2db71 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@j9t/imagemin-guard", "description": "Ensure losslessly compressed JPG, PNG, GIF, WebP, and AVIF images (suitable for manual and automatic compression)", "author": "Jens Oliver Meiert", - "version": "3.3.3", + "version": "3.3.4", "type": "module", "license": "Apache-2.0", "repository": {