Skip to content

Commit

Permalink
Minor cleanup after #21
Browse files Browse the repository at this point in the history
  • Loading branch information
coenjacobs committed Jun 27, 2019
1 parent 12e5a00 commit 9002099
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Mover.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,18 @@ public function moveFile(Package $package, $autoloader, $file, $path = '')
$namespacePath = $autoloader->getNamespacePath();
$replaceWith = $this->config->dep_directory . $namespacePath;
$targetFile = str_replace($this->workingDir, $replaceWith, $file->getRealPath());

$packageVendorPath = '/vendor/' . $package->config->name . '/' . $path;
$osSpecificPackageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($osSpecificPackageVendorPath, '', $targetFile);
$packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($packageVendorPath, '', $targetFile);
} else {
$namespacePath = $package->config->name;
$replaceWith = $this->config->classmap_directory . '/' . $namespacePath;
$targetFile = str_replace($this->workingDir, $replaceWith, $file->getRealPath());

$packageVendorPath = '/vendor/' . $package->config->name . '/';
$osSpecificPackageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($osSpecificPackageVendorPath, DIRECTORY_SEPARATOR, $targetFile);
$packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($packageVendorPath, DIRECTORY_SEPARATOR, $targetFile);
}

$this->filesystem->copy(
Expand Down

0 comments on commit 9002099

Please sign in to comment.