Skip to content

Commit

Permalink
ConsoleScript: Allow to include single files by passing them via --ma…
Browse files Browse the repository at this point in the history
…ke (pmmp#52)
  • Loading branch information
TheNewHEROBRINEX authored Jan 11, 2021
1 parent 963981d commit 674cada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DevTools/ConsoleScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function preg_quote_array(array $strings, string $delim = null) : array{
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) : string{
return rtrim(str_replace("/", DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$path = rtrim(str_replace("/", DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR);
return is_dir($path) ? $path . DIRECTORY_SEPARATOR : $path;
}, $includedPaths);
if(file_exists($pharPath)){
yield "Phar file already exists, overwriting...";
Expand Down

0 comments on commit 674cada

Please sign in to comment.