Skip to content

Commit

Permalink
ConsoleScript: fix implicit dependencies on directory separators
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jun 14, 2019
1 parent c0f0f93 commit bf23e10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DevTools/ConsoleScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ function preg_quote_array(array $strings, string $delim = null) : array{
* @return Generator|string[]
*/
function buildPhar(string $pharPath, string $basePath, array $includedPaths, array $metadata, string $stub, int $signatureAlgo = \Phar::SHA1, ?int $compression = null){
$basePath = rtrim(str_replace("/", DIRECTORY_SEPARATOR, $basePath), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$includedPaths = array_map(function($path){
return rtrim(str_replace("/", DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}, $includedPaths);
if(file_exists($pharPath)){
yield "Phar file already exists, overwriting...";
try{
Expand Down

0 comments on commit bf23e10

Please sign in to comment.