mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 02:28:55 +00:00
Fix #117 ENOENT when infering flash
This commit is contained in:
parent
866991d6a1
commit
0ed5bd8c7b
@ -29,8 +29,18 @@ function inferFlash() {
|
||||
*/
|
||||
function findSync(pattern, base, findDir) {
|
||||
const matches = [];
|
||||
|
||||
(function findSyncRecurse(base) {
|
||||
const children = fs.readdirSync(base);
|
||||
let children;
|
||||
try {
|
||||
children = fs.readdirSync(base);
|
||||
} catch (exception) {
|
||||
if (exception.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
throw exception;
|
||||
}
|
||||
|
||||
children.forEach(child => {
|
||||
const childPath = path.join(base, child);
|
||||
const childIsDirectory = fs.lstatSync(childPath).isDirectory();
|
||||
|
Loading…
Reference in New Issue
Block a user