Skip to content

Commit

Permalink
chenge foreach to for
Browse files Browse the repository at this point in the history
  • Loading branch information
julz0815 committed Mar 28, 2024
1 parent d19f69d commit e105798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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}`
Expand All @@ -19267,7 +19267,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) {
console.log(outputXML.indexOf('Uploaded'))
count++
}
});
};
}

return count;
Expand Down
8 changes: 4 additions & 4 deletions src/services/scan-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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}`
Expand All @@ -116,7 +116,7 @@ async function uploadFile(vid, vkey, jarName, appId, filepath, sandboxID) {
console.log(outputXML.indexOf('Uploaded'))
count++
}
});
};
}

return count;
Expand Down

0 comments on commit e105798

Please sign in to comment.