Skip to content

Commit 24dd28f

Browse files
committed
renaming and move the preinstallcmd code
1 parent 779bc96 commit 24dd28f

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/PatternLab/InstallerUtil.php

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -415,30 +415,6 @@ public static function postPackageUpdate($event) {
415415

416416
}
417417

418-
/**
419-
* Make sure certain things are set-up before running the installation of dependencies for a project
420-
* @param {Object} a script event object from composer
421-
*/
422-
public static function postRootPackageInstall($event) {
423-
424-
// run the console and config inits
425-
self::init();
426-
427-
// default vars
428-
$sourceDir = Config::getOption("sourceDir");
429-
$packagesDir = Config::getOption("packagesDir");
430-
431-
// check directories
432-
if (!is_dir($sourceDir)) {
433-
mkdir($sourceDir);
434-
}
435-
436-
if (!is_dir($packagesDir)) {
437-
mkdir($packagesDir);
438-
}
439-
440-
}
441-
442418
/**
443419
* Ask questions after the create package is done
444420
* @param {Object} a script event object from composer
@@ -476,6 +452,29 @@ public static function postCreateProjectCmd($event) {
476452

477453
}
478454

455+
/**
456+
* Make sure certain things are set-up before running the installation of a package
457+
* @param {Object} a script event object from composer
458+
*/
459+
public static function preInstallCmd($event) {
460+
461+
// run the console and config inits
462+
self::init();
463+
464+
// default vars
465+
$sourceDir = Config::getOption("sourceDir");
466+
$packagesDir = Config::getOption("packagesDir");
467+
468+
// check directories
469+
if (!is_dir($sourceDir)) {
470+
mkdir($sourceDir);
471+
}
472+
473+
if (!is_dir($packagesDir)) {
474+
mkdir($packagesDir);
475+
}
476+
477+
}
479478

480479
/**
481480
* Make sure pattern engines and listeners are removed on uninstall

0 commit comments

Comments
 (0)