Skip to content

Add --github flag to scaffold plugin from a repository #158

@rheinardkorf

Description

@rheinardkorf

Issue

Currently when using wp scaffold plugin you are limited to the provided plugin architecture. This is not ideal where you might have your own architecture you would like to use. In most cases this can be solved with other scripts, but it takes you outside of the convenience of wp-cli.

Proposal

Add a new --github flag which will allow wp scaffold plugin to checkout a source that will be used for scaffolding.

Example usage:

# Checkout default branch and use for scaffolding.
wp scaffold plugin --github=myorg/mypluginbase

# Checkout alternate branch to use for scaffolding.
wp scaffold plugin --github=myorg/mypluginbase:alternate-branch

Considerations

  1. exec() vs PHP git library
  2. Replacement patterns for source files (and the methods to do the replacing)
  3. Alternate method to determine successful checkout and replacement than log_whether_files_written

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions