Add missing semicolons

This commit is contained in:
SileNce5k 2022-08-18 23:15:51 +02:00
parent 78a98e70cc
commit 7a7dc93e4e
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -27,19 +27,19 @@ function printHelp(){
} }
function fileNotFound(pathToTextFile) { function fileNotFound(pathToTextFile) {
console.log(`FILE NOT FOUND: ${pathToTextFile}\n`) console.log(`FILE NOT FOUND: ${pathToTextFile}\n`);
process.exit(404) process.exit(404);
} }
function cleanFile(pathToTextFile) { function cleanFile(pathToTextFile) {
let file = fs.readFileSync(pathToTextFile).toString(); let file = fs.readFileSync(pathToTextFile).toString();
const regex = /(\[)(.*)(\])/gm const regex = /(\[)(.*)(\])/gm;
file = file.replace(regex, ""); file = file.replace(regex, "");
let newPath = `CLEANED_${path.basename(pathToTextFile)}` let newPath = `CLEANED_${path.basename(pathToTextFile)}`;
fs.writeFileSync(newPath, file); fs.writeFileSync(newPath, file);
console.log(`\nWrote new file to ${newPath}`) console.log(`\nWrote new file to ${newPath}`);
} }
let pathToTextFile = argHandler(process.argv); let pathToTextFile = argHandler(process.argv);
fs.existsSync(pathToTextFile) ? cleanFile(pathToTextFile) : fileNotFound(pathToTextFile) fs.existsSync(pathToTextFile) ? cleanFile(pathToTextFile) : fileNotFound(pathToTextFile);