Skip to content

Commit

Permalink
Merge pull request #21 from kmgalanakis/fix-windows-compatibility
Browse files Browse the repository at this point in the history
Fix Windows compatibility.
  • Loading branch information
coenjacobs authored Jun 25, 2019
2 parents b60bf3f + 65e3ecf commit a7d54e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mover.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ 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());
$targetFile = str_replace('/vendor/' . $package->config->name . '/' . $path, '', $targetFile);
$packageVendorPath = '/vendor/' . $package->config->name . '/' . $path;
$osSpecificPackageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($osSpecificPackageVendorPath, '', $targetFile);
} else {
$namespacePath = $package->config->name;
$replaceWith = $this->config->classmap_directory . '/' . $namespacePath;
$targetFile = str_replace($this->workingDir, $replaceWith, $file->getRealPath());
$targetFile = str_replace('/vendor/' . $package->config->name . '/', '/', $targetFile);
$packageVendorPath = '/vendor/' . $package->config->name . '/';
$osSpecificPackageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath);
$targetFile = str_replace($osSpecificPackageVendorPath, DIRECTORY_SEPARATOR, $targetFile);
}

$this->filesystem->copy(
Expand Down

0 comments on commit a7d54e1

Please sign in to comment.