Skip to content

Commit b04b593

Browse files
committed
Ensure trailing separator on --path
1 parent 69e0551 commit b04b593

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

composer-lock-diff

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ function joinPath(/* path parts */) {
416416
}, func_get_args()));
417417
}
418418

419+
function ensureTrailingPathSep($path) {
420+
return trim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
421+
}
422+
419423
function parseOpts() {
420424
$given = getopt('hp:', array('path:', 'from:', 'to:', 'md', 'json', 'pretty', 'no-links', 'only-prod', 'only-dev', 'help', 'vcs:'));
421425

@@ -437,7 +441,7 @@ function parseOpts() {
437441
}
438442

439443
return array(
440-
'path' => array_key_exists('path', $given) ? $given['path'] : '',
444+
'path' => array_key_exists('path', $given) ? ensureTrailingPathSep($given['path']) : '',
441445
'from' => array_key_exists('from', $given) ? $given['from'] : '',
442446
'to' => array_key_exists('to', $given) ? $given['to'] : '',
443447
'md' => array_key_exists('md', $given),

0 commit comments

Comments
 (0)