forked from github/cordova-android
CB-10660 fixed the exception when removing a non-existing directory. This closes #261
This commit is contained in:
parent
757a3685f2
commit
0a1b71f125
2
bin/templates/cordova/lib/pluginHandlers.js
vendored
2
bin/templates/cordova/lib/pluginHandlers.js
vendored
@ -96,7 +96,7 @@ var handlers = {
|
|||||||
subDir = path.resolve(project.projectDir, subRelativeDir);
|
subDir = path.resolve(project.projectDir, subRelativeDir);
|
||||||
// If it's the last framework in the plugin, remove the parent directory.
|
// If it's the last framework in the plugin, remove the parent directory.
|
||||||
var parDir = path.dirname(subDir);
|
var parDir = path.dirname(subDir);
|
||||||
if (fs.readdirSync(parDir).length === 0) {
|
if (fs.existsSync(parDir) && fs.readdirSync(parDir).length === 0) {
|
||||||
fs.rmdirSync(parDir);
|
fs.rmdirSync(parDir);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user