diff --git a/src/ThinkFramework.php b/src/ThinkFramework.php index 07d2218..17dd311 100644 --- a/src/ThinkFramework.php +++ b/src/ThinkFramework.php @@ -4,6 +4,7 @@ use Composer\Package\PackageInterface; use Composer\Installer\LibraryInstaller; +use Composer\Repository\InstalledRepositoryInterface; class ThinkFramework extends LibraryInstaller { @@ -27,6 +28,20 @@ public function getInstallPath(PackageInterface $package) return 'thinkphp'; } + public function install(InstalledRepositoryInterface $repo, PackageInterface $package) + { + parent::install($repo, $package); + //remove tests dir + $this->filesystem->removeDirectory($this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'tests'); + } + + public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) + { + parent::update($repo, $initial, $target); + //remove tests dir + $this->filesystem->removeDirectory($this->getInstallPath($target) . DIRECTORY_SEPARATOR . 'tests'); + } + /** * {@inheritDoc} */