CB-10660 fixed the exception when removing a non-existing directory. This closes #261

This commit is contained in:
Byoungro So 2016-02-21 16:25:21 -08:00 committed by Vladimir Kotikov
parent 757a3685f2
commit 0a1b71f125

View File

@ -96,7 +96,7 @@ var handlers = {
subDir = path.resolve(project.projectDir, subRelativeDir);
// If it's the last framework in the plugin, remove the parent directory.
var parDir = path.dirname(subDir);
if (fs.readdirSync(parDir).length === 0) {
if (fs.existsSync(parDir) && fs.readdirSync(parDir).length === 0) {
fs.rmdirSync(parDir);
}
} else {