Skip to content

Commit

Permalink
Merge pull request #135 from hiroyone/fix/runner-results#56
Browse files Browse the repository at this point in the history
Fix the logic
  • Loading branch information
tnicola authored Dec 4, 2022
2 parents 985cb27 + ebda0b2 commit b80ee88
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ const {
const { executeThread } = require('./thread');
const { resultsPath } = require('./shared-config');

function cleanResultsPath() {
fs.remove(resultsPath);
}
function cleanResultsPath() {
if(!fs.existsSync(resultsPath)) {
fs.mkdirSync(resultsPath, { recursive: true })
} else {
fs.readdir(resultsPath, (err, files) => {
if (err) console.log(err);
for (const file of files) {
fs.unlink(path.join('path here', file), err => { if (err) console.log(err); });
}
});
}
}

async function start() {
cleanResultsPath();
Expand Down

0 comments on commit b80ee88

Please sign in to comment.