Automattic / team51-cli

A tool for provisioning and connecting GitHub repos, Pressable WordPress sites and DeployHQ.
MIT License
12 stars 0 forks source link

Graceful erroring when create-development-site from a "-development" site #171

Open ecairol opened 1 year ago

ecairol commented 1 year ago

When running the command create-development-site on a site that's not production (eg: site 1201569), the value for $project_name still contains that -development portion of the string, causing the error Failed to retrieve project info from DeployHQ. Aborting!

The clone does succeed on Pressable, but since the code exit() at that point, no further POST is sent to DeployHQ.

Suggested change:

Strip off any -development string from line 61 $project_name = $pressable_site->data->name;, but need to verify that won't cause any other bugs.

Otherwise, tell the user that the site was created in Pressable but the DeployHQ config couldn't be completed. Ideally display the project_name in the error.

Slack thread.

ahegyes commented 7 months ago

The new CLI explicitly allows cloning clones 😄 Should we consider this issue closed in light of that (since we'll be migrating to it soon)?

ecairol commented 7 months ago

Sounds good to me! Maybe just test on the new CLI before closing this one?