Skip to content

Commit df8a9c9

Browse files
authored
Fix for specifying a directory in a package when deploying from windows (#73)
* Update finder to avoid using SplFileInfo getPath which causes issues on windows paths * Add normalizeSeparators to Package * Fix normalizeSeparators styling
1 parent 627d157 commit df8a9c9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Package.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ public function getFilename()
304304
return "sidecar/{$this->packagingVersion()}-{$this->hash()}.zip";
305305
}
306306

307+
/**
308+
* @return string
309+
*/
310+
public function normalizeSeparators($file)
311+
{
312+
return str_replace(DIRECTORY_SEPARATOR, '/', $file);
313+
}
314+
307315
/**
308316
* @return string
309317
*
@@ -351,19 +359,19 @@ public function upload()
351359
// Remove the base path so that everything inside
352360
// the zip is relative to the project root.
353361
$zip->addFileFromPath(
354-
$this->removeBasePath($file), $file, $options
362+
$this->normalizeSeparators($this->removeBasePath($file)), $file, $options
355363
);
356364
}
357365

358366
foreach ($this->exactIncludes as $source => $destination) {
359367
$zip->addFileFromPath(
360-
$destination, $source, $options
368+
$this->normalizeSeparators($destination), $source, $options
361369
);
362370
}
363371

364372
foreach ($this->stringContents as $destination => $stringContent) {
365373
$zip->addFile(
366-
$destination, $stringContent, $options
374+
$this->normalizeSeparators($destination), $stringContent, $options
367375
);
368376
}
369377

0 commit comments

Comments
 (0)