This commit is contained in:
andrei-mihnea-cerbu
2024-04-23 20:59:23 +03:00
parent 677295e176
commit 754ca11887
20 changed files with 106 additions and 20 deletions
+28
View File
@@ -0,0 +1,28 @@
const fs = require('fs');
const path = require('path');
// List of files you want to check and delete
const filesToDelete = [
path.join(__dirname, '..', 'backupSchemes.json'),
path.join(__dirname, '..', 'dirBackup.json'),
path.join(__dirname, '..', 'dirShare.json'),
path.join(__dirname, '..', 'usersInSystem.json'),
path.join(__dirname, '..', 'loginData.json'),
path.join(__dirname, '..', 'ipConfig.json')
];
filesToDelete.forEach(file => {
fs.access(file, fs.constants.F_OK, (err) => {
if (!err) {
fs.unlink(file, err => {
if (err) {
console.error(`Failed to delete ${file}: ${err}`);
} else {
console.log(`${file} was deleted successfully.`);
}
});
} else {
console.log(`${file} does not exist.`);
}
});
});