Script to check pads to delete when account deletion request

This commit is contained in:
yflory
2018-04-04 12:06:59 +02:00
parent 31980bef82
commit 337138d6e5
3 changed files with 84 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ const hashesFromPinFile = (pinFile, fileName) => {
switch (l[0]) {
case 'RESET': {
pins = {};
if (l[1] && l[1].length) { l[1].forEach((x) => { pins[x] = 1; }); }
//jshint -W086
// fallthrough
}
@@ -32,7 +33,7 @@ const hashesFromPinFile = (pinFile, fileName) => {
return Object.keys(pins);
};
module.exports.load = function (cb) {
module.exports.load = function (cb, config) {
nThen((waitFor) => {
Fs.readdir('./pins', waitFor((err, list) => {
if (err) {
@@ -49,7 +50,10 @@ module.exports.load = function (cb) {
sema.take((returnAfter) => {
Fs.readdir('./pins/' + f, waitFor(returnAfter((err, list2) => {
if (err) { throw err; }
list2.forEach((ff) => { fileList.push('./pins/' + f + '/' + ff); });
list2.forEach((ff) => {
if (config && config.exclude && config.exclude.indexOf(ff) > -1) { return; }
fileList.push('./pins/' + f + '/' + ff);
});
})));
});
});
@@ -76,4 +80,4 @@ if (!module.parent) {
console.log(x + ' ' + JSON.stringify(data[x]));
});
});
}
}