wordpress-mobile / release-toolkit-gutenberg-mobile

Automation Scripts for Releasing Gutenberg-Mobile Updates to the WordPress Mobile Apps.
Mozilla Public License 2.0
5 stars 2 forks source link

CLI: Refactor the temp directories in the commands #180

Closed jhnstn closed 10 months ago

jhnstn commented 10 months ago

This introduces a workspace package in the cmd directory.

Basic Usage: workspace := wp.NewWorkspace()

workspace.Dir() returns the directory of the workspace. workspace.Cleanup() cleans up a temp directory if one was created workspace.Keep() once called the clean up flows will not delete the temp directory.

The workspace can be disabled by setting the env GBM_NO_WORKSPACE. In this case a temp directory is not created. The rest of the script will use the current directory to fetch and update files.

Testing: