You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command works but I receive no result when this is passed: drush user:create "Jayda Kozey" --mail="jayda.kozey@ethereal.email" --password="ManbQBMZ5ERXPWbQ2Y"
However, the same code (which is standard) is able to capture other output from Drush commands via cy.exec(), such as:
To Reproduce
In Cypress (or perhaps any other Node shell), run the cy.exec() and test the output.
Expected behavior
Should receive [success] Created a new user with uid 57
Then I can match against "/Created a new user with uid ([0-9]+)/" to obtain the UID.
Actual behavior
"Output" above is ''.
Workaround
Once the account is created, use drush user:info with the account email and --format=json. Search for the UID in the json object (see below).
System Configuration
Q
A
Drush version?
11.6
Drupal version?
10.0.9
PHP version
8.1.3
OS?
macOs
Additional information
It would be great to correct this. However, another possible solution is to allow --format=json with user:create so that the UID is returned as part of the same structure as user:info, including all roles, etc. after all hooks have fired. (Or before the hooks, that's not the important bit.)
Describe the bug
In Cypress, I'm using the following code to capture the output of user:create:
The command works but I receive no result when this is passed:
drush user:create "Jayda Kozey" --mail="jayda.kozey@ethereal.email" --password="ManbQBMZ5ERXPWbQ2Y"
However, the same code (which is standard) is able to capture other output from Drush commands via cy.exec(), such as:
drush user:info --mail="jayda.kozey@ethereal.email" --format=json
"Output" is:
To Reproduce
In Cypress (or perhaps any other Node shell), run the cy.exec() and test the output.
Expected behavior
Should receive
[success] Created a new user with uid 57
Then I can match against "/Created a new user with uid ([0-9]+)/" to obtain the UID.
Actual behavior
"Output" above is ''.
Workaround
Once the account is created, use drush user:info with the account email and --format=json. Search for the UID in the json object (see below).
System Configuration
Additional information
It would be great to correct this. However, another possible solution is to allow --format=json with user:create so that the UID is returned as part of the same structure as user:info, including all roles, etc. after all hooks have fired. (Or before the hooks, that's not the important bit.)
Something like:
drush user:create "Jayda Kozey" --mail="jayda.kozey@ethereal.email" --password --format=json
"Output:"
The text was updated successfully, but these errors were encountered: