From e10579818327be8e117f2895c86942c61ce8f0f2 Mon Sep 17 00:00:00 2001 From: Julian Totzek-Hallhuber Date: Thu, 28 Mar 2024 08:07:59 +0100 Subject: [PATCH] chenge foreach to for --- dist/index.js | 8 ++++---- src/services/scan-service.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index d849105..b5d01a7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19218,10 +19218,10 @@ async function createSandboxBuild(vid, vkey, jarName, appId, version, deleteinco return buildId; } -let count = 0; + async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { let command; - + let count = 0; const stat = util.promisify(fs.stat); const stats = await stat(filepath); @@ -19250,7 +19250,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { const filesPromis = util.promisify(fs.readdir); const files = await filesPromis(filepath); - files.forEach(async file => { + for (const file of files) { if ( sandboxID > 1){ core.info(`Uploading artifact ${file} to Sandbox: ${sandboxID}`); command = `java -jar ${jarName} -vid ${vid} -vkey ${vkey} -action UploadFile -appid ${appId} -filepath ${filepath}${file} -sandboxid ${sandboxID}` @@ -19267,7 +19267,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { console.log(outputXML.indexOf('Uploaded')) count++ } - }); + }; } return count; diff --git a/src/services/scan-service.js b/src/services/scan-service.js index 2ac305b..b01e1b9 100644 --- a/src/services/scan-service.js +++ b/src/services/scan-service.js @@ -67,10 +67,10 @@ async function createSandboxBuild(vid, vkey, jarName, appId, version, deleteinco return buildId; } -let count = 0; + async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { let command; - + let count = 0; const stat = util.promisify(fs.stat); const stats = await stat(filepath); @@ -99,7 +99,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { const filesPromis = util.promisify(fs.readdir); const files = await filesPromis(filepath); - files.forEach(async file => { + for (const file of files) { if ( sandboxID > 1){ core.info(`Uploading artifact ${file} to Sandbox: ${sandboxID}`); command = `java -jar ${jarName} -vid ${vid} -vkey ${vkey} -action UploadFile -appid ${appId} -filepath ${filepath}${file} -sandboxid ${sandboxID}` @@ -116,7 +116,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) { console.log(outputXML.indexOf('Uploaded')) count++ } - }); + }; } return count;