Skip to content

Commit 68d0f28

Browse files
authored
Update src/ScaffoldPackageCommand.php
1 parent 528ee61 commit 68d0f28

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ScaffoldPackageCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ public function package( $args, $assoc_args ) {
105105
}
106106

107107
// Convert to absolute path if relative.
108-
if ( ! preg_match( '#^([a-zA-Z]:)?[\\\\/]#', $package_dir ) ) {
109-
$package_dir = getcwd() . DIRECTORY_SEPARATOR . $package_dir;
108+
if ( ! preg_match( '#^([a-zA-Z]:)?[\\/]#', $package_dir ) ) {
109+
$cwd = getcwd();
110+
if ( false === $cwd ) {
111+
WP_CLI::error( 'Could not determine current working directory.' );
112+
}
113+
$package_dir = $cwd . DIRECTORY_SEPARATOR . $package_dir;
110114
}
111115

112116
if ( empty( $assoc_args['homepage'] ) ) {

0 commit comments

Comments
 (0)