mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-24 16:56:16 -04:00
Cleanup unused files
This commit is contained in:
parent
aa9e9497d6
commit
c962909c0e
33 changed files with 5 additions and 1206 deletions
|
@ -1,34 +0,0 @@
|
|||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* @param {Array<string>} files
|
||||
* @param {Function} cb
|
||||
*/
|
||||
|
||||
function ensureFiles(files, cb) {
|
||||
var missingFiles = files.reduce(function(prev, filePath) {
|
||||
var fileFound = false;
|
||||
|
||||
try {
|
||||
fileFound = fs.statSync(filePath).isFile();
|
||||
} catch (e) { }
|
||||
|
||||
if (!fileFound) {
|
||||
prev.push(filePath + ' Not Found');
|
||||
}
|
||||
|
||||
return prev;
|
||||
}, []);
|
||||
|
||||
if (missingFiles.length) {
|
||||
var err = new Error('Missing Required Files\n' + missingFiles.join('\n'));
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
cb(err);
|
||||
} else if (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ensureFiles;
|
Loading…
Add table
Add a link
Reference in a new issue