Conversation
|
I tested other commands, and on the first one I got an unhandled exception: Not sure if I needed to pass another argument to make it work, however, for sure the unhandled exception should not be happening. Correct? |
| }, | ||
| async () => { | ||
| // 0: node, 1: wp-now, 2: wp, 3: [wp-cli options...] | ||
| const args = process.argv.slice(3); |
There was a problem hiding this comment.
Suggestion: Can we replace the 3 with something that express better your comment?
Eg:
const args = {
node: 0,
wpNow: 1,
wp: 2,
wpCliOptions: 3
}
There was a problem hiding this comment.
Wouldn't yargs provide you a list of everything that comes after the command?
| * Test wp-cli eval-file works correctly. | ||
| * We will use the context of Playground mode. | ||
| */ | ||
| test('wp-cli eval-file works correctly', async () => { |
There was a problem hiding this comment.
TIL about that command, how lovely!
|
|
|
@n3f what would be a reproduction? |
I just followed the instructions in the PR then as an additional case ran |
|
@n3f , thanks for testing it. Maybe it's a matter of using the latest dependencies.
|

What?
Brings
wp-cliexecution towp-nowwith the current site context.The new command will be
wp-now wp ...I'm open to other command names, like
cli.Why?
wp-cli is a handy tool for all WordPress developers opening a wide range of automatizations.
How?
wp-cli was intentionally removed until the Playground was mature enough to support a wide range of operations.
I added a new command that calls
executeWPCli, which downloads the phar file and mounts the current directory to make easier the execution of local files witheval-file.Testing Instructions
nvm use && npm install && npx nx build wp-nownpx nx run wp-now:testnode dist/packages/wp-now/cli.js wp eval-file /./foo.phpnode dist/packages/wp-now/cli.js wp cli version