Skip to content

Commit bc59a0b

Browse files
committed
remove components if installed for a given package that's being deleted
1 parent 0cee5e6 commit bc59a0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PatternLab/InstallerUtil.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,11 @@ public static function prePackageUninstallCmd($event) {
542542
self::scanForPatternEngineRule($pathBase,true);
543543
}
544544

545-
// go over .json in patternlab-components/, remove references to packagename
545+
// remove the component package file if it exists
546+
$jsonFile = Config::getOption("componentDir")."/packages/".str_replace("/","-",$name).".json";
547+
if (file_exists($jsonFile)) {
548+
unlink($jsonFile);
549+
}
546550

547551
}
548552

0 commit comments

Comments
 (0)