The first 4 commits are minor (typos, grammar mistakes, and JSDoc comments). The actual change (related to #113) is in 96ef4ff and affects the following files:
lib/cli/index.js
lib/cli/commands/wp.js
lib/cypress-support/commands.js
lib/modules/run.js
It basically introduces the -w (or --write-to-stdout) flag for the wp command:
program
.command('wp')
.description('Execute the WordPress CLI in the running container')
.option('<command>', 'The WP-CLI command to execute')
.option('-w,--write-to-stdout', 'Whether to write the output to stdout')
.action((options) => {
const command = options.args.join(' ');
wp(command, packageDir, logFile, !!options.writeToStdout);
});
and adds an additional (boolean) parameter for that flag to:
wp() (in lib/cli/commands/wp.js), which simply passes the value to run()
run() (in /lib/modules/run.js), which uses that value to determine whether we should write to stdout or not (that way, we prevent CLI users from getting duplicate output)
if (writeToStdout) {
process.stdout.write(succeed || stdout);
}
The new writeToStdout parameter is going to be false, by default. We're only setting the flag for the WP Cypress commands in lib/cli/cypress-support/commands.js.
I've tested the changes described in this PR on a couple of projects (and with my own Cypress commands) and AFAICT everything is working as expected.
Let me know if you need any more information! 🙂
Change Log
Writes command output to stdout while keeping stderr as it is, to prevent any breaking changes (as described in #113). It introduces an internally used -w, --write-to-stdout flag for the wp command, to prevent CLI users from getting a duplicate output.
In addition to the stdout change, this PR fixes a few minor typos and grammar mistakes
and improves JSDoc comments a bit (consistent tags, capitalization, updates mismatching param names, documents object structures, and adds missing @return tags)
Screenshots/Videos
N/A
Types of changes (if applicable):
[ ] Bug fix (non-breaking change which fixes an issue).
[x] New feature (non-breaking change which adds functionality).
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
Description
Fixes #113.
The first 4 commits are minor (typos, grammar mistakes, and JSDoc comments). The actual change (related to #113) is in 96ef4ff and affects the following files:
lib/cli/index.js
lib/cli/commands/wp.js
lib/cypress-support/commands.js
lib/modules/run.js
It basically introduces the
-w
(or--write-to-stdout
) flag for thewp
command:and adds an additional (
boolean
) parameter for that flag to:wp()
(inlib/cli/commands/wp.js
), which simply passes the value torun()
run()
(in/lib/modules/run.js
), which uses that value to determine whether we should write tostdout
or not (that way, we prevent CLI users from getting duplicate output)The new
writeToStdout
parameter is going to befalse
, by default. We're only setting the flag for the WP Cypress commands inlib/cli/cypress-support/commands.js
.So, we're essentially changing this:
to that:
I've tested the changes described in this PR on a couple of projects (and with my own Cypress commands) and AFAICT everything is working as expected.
Let me know if you need any more information! 🙂
Change Log
stdout
while keepingstderr
as it is, to prevent any breaking changes (as described in #113). It introduces an internally used-w, --write-to-stdout
flag for thewp
command, to prevent CLI users from getting a duplicate output.stdout
change, this PR fixes a few minor typos and grammar mistakes@return
tags)Screenshots/Videos
N/A
Types of changes (if applicable):
Checklist (if applicable):