From 1ea3955b60e94b26febe19e46fb520fef187f83f Mon Sep 17 00:00:00 2001 From: ryan tsou Date: Fri, 3 Apr 2026 21:35:28 +0200 Subject: [PATCH] Remove incorrect await from synchronous fs functions The await keyword should not be used with fs.statSync() and fs.readFileSync() as these are synchronous functions that do not return Promises. This was causing unnecessary awaits in the code. --- sync.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync.js b/sync.js index 488f8d02..d7b0b5cd 100644 --- a/sync.js +++ b/sync.js @@ -55,10 +55,10 @@ function downloadFile(url, dest) { async function syncFilesUp() { for (const fileName of filesToSync) { const filePath = path.resolve(path.join(dirToSync, fileName)) - const stat = await fs.statSync(filePath) + const stat = fs.statSync(filePath) if (stat.isFile()) { - const fileContent = await fs.readFileSync(filePath) + const fileContent = fs.readFileSync(filePath) await put(fileName, fileContent, { access: 'public', addRandomSuffix: false }) } }