fix isDirectory() to return false instead of failing

This commit is contained in:
Philipp Kunz 2017-05-07 20:50:59 +02:00
parent 51f9d76a64
commit bd50c122eb
2 changed files with 12 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,11 @@ export let fileExists = function (filePath) {
* Checks if given path points to an existing directory
*/
export let isDirectory = function (pathArg): boolean {
return plugins.fsExtra.statSync(pathArg).isDirectory()
try {
return plugins.fsExtra.statSync(pathArg).isDirectory()
} catch (err) {
return false
}
}
/**