public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $downloadPath = $this->getInstallPath($package);
     $fileSystem = new Filesystem();
     $actualLegacyDir = $this->innomaticLegacyDir;
     $this->innomaticLegacyDir = $packageDir = $this->generateTempDirName();
     if ($this->io->isVerbose()) {
         $this->io->write("Installing in temporary directory.");
     }
     parent::install($repo, $package);
     if ($this->io->isVerbose()) {
         $this->io->write("Installing inside Innomatic legacy.");
     }
     $this->deployApplication($packageDir);
     $fileSystem->remove($this->innomaticLegacyDir);
     $this->innomaticLegacyDir = $actualLegacyDir;
 }
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $downloadPath = $this->getInstallPath($package);
     $fileSystem = new Filesystem();
     $actualLegacyDir = $this->innomaticLegacyDir;
     $this->innomaticLegacyDir = $this->generateTempDirName();
     if (!is_dir($downloadPath) || $fileSystem->isDirEmpty($downloadPath)) {
         if ($this->io->isVerbose()) {
             $this->io->write("Installing in temporary directory.");
         }
         parent::install($repo, $package);
         if ($this->io->isVerbose()) {
             $this->io->write("Copying to the Innomatic legacy directory.");
         }
         $fileSystem->copyThenRemove($this->innomaticLegacyDir . '/source/', $actualLegacyDir);
         $this->innomaticLegacyDir = $actualLegacyDir;
     }
 }