Skip to content

Commit 7990816

Browse files
Copilotswissspidy
andauthored
Fix Windows HOME path detection and mock remote readme body
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 12a3ce8 commit 7990816

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

features/scaffold-package-readme.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ Feature: Scaffold a README.md file for an existing package
190190

191191
Scenario: Scaffold a readme with a remote support body
192192
Given an empty directory
193+
And that HTTP requests to https://gist.githubusercontent.com/danielbachhuber/bb652b1b744cea541705ee9c13605dad/raw/195c17ebb8cf25e947a9df6e02de1e96a084c287/support.md will respond with:
194+
"""
195+
HTTP/1.1 200 OK
196+
Content-Type: text/plain
197+
198+
Support isn't free!
199+
"""
193200
And a foo/composer.json file:
194201
"""
195202
{
@@ -217,6 +224,13 @@ Feature: Scaffold a README.md file for an existing package
217224

218225
Scenario: Scaffold a readme with a pre, post and body for the section
219226
Given an empty directory
227+
And that HTTP requests to https://gist.githubusercontent.com/danielbachhuber/bb652b1b744cea541705ee9c13605dad/raw/195c17ebb8cf25e947a9df6e02de1e96a084c287/support.md will respond with:
228+
"""
229+
HTTP/1.1 200 OK
230+
Content-Type: text/plain
231+
232+
Support isn't free!
233+
"""
220234
And a foo/composer.json file:
221235
"""
222236
{

src/ScaffoldPackageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function package( $args, $assoc_args ) {
135135
}
136136

137137
// Convert to absolute path if relative.
138-
if ( ! preg_match( '#^([a-zA-Z]:)?[\\/]#', $package_dir ) ) {
138+
if ( ! preg_match( '#^([a-zA-Z]:)?[\\\\/]#', $package_dir ) ) {
139139
$cwd = getcwd();
140140
if ( false === $cwd ) {
141141
WP_CLI::error( 'Could not determine current working directory.' );

0 commit comments

Comments
 (0)