scaffold-package-command
scaffold-package-command copied to clipboard
Behat files empty after scaffolding
Bug Report
Describe the current, buggy behavior
when running $ wp scaffold package anauthor/test --dir=~/testscaffold or $ wp scaffold package-tests ~/testscaffold --force
I get multiple errors about not not being able to open stream in 'vendor/wp-cli/wp-cli/features/xxx.php
e.g.
'vendor/wp-cli/wp-cli/features/steps/then.php'
And when I look in the folder and open the file it is empty. i.e. the above mentioned file in the features/steps folder is empty.
Describe how other contributors can replicate this bug
- Create a folder called 'testscaffold'
- run '$ wp scaffold package anauthor/test --dir=~/testscaffold'
Describe what you would expect as the correct outcome
The required behat files to be created
Let us know what environment you are running this on
OS: Linux 4.18.0-21-generic #22~18.04.1-Ubuntu SMP Thu May 16 15:07:19 UTC 2019 x86_64 Shell: /bin/bash PHP binary: /usr/bin/php7.2 PHP version: 7.2.19-0ubuntu0.18.04.1 php.ini used: /etc/php/7.2/cli/php.ini WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli WP-CLI vendor dir: phar://wp-cli.phar/vendor WP_CLI phar path: /home/chris WP-CLI packages dir: /home/chris/.wp-cli/packages/ WP-CLI global config: WP-CLI project config: WP-CLI version: 2.2.0
Provide a possible solution
Provide additional context/Screenshots
Success: Created package files in /home/chris/testscaffold PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/bootstrap/FeatureContext.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/bootstrap/FeatureContext.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/bootstrap/support.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/bootstrap/support.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/ci/behat-tags.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/ci/behat-tags.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/given.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/given.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/when.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/when.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/then.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/then.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684 PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/extra/no-mail.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/extra/no-mail.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
Thanks for the reminder, the wp-cli/scaffold-package-command still needs a few tweaks to adapt to the current packaging structure.
I'll try to make this a priority.
Cool, let me know when it's done and I will test it. In the meantime the workaround (for anyone else reading this) is simply to copy the missing files from the repo.
As of WP-CLI version: 2.10.0, I cannot reproduce this issue now.