Skip to content

Tool to increment the version number of a plugin #169

@BrianHenryIE

Description

@BrianHenryIE

When developing plugins and releasing new versions, I need to increment the version in three locations:

  • the plugin file header
  • defined as a const in the plugin file PHP body
  • in a getter in my settings.php.

I'm thinking ~ wp increment-plugin-version plugin.php /list/of/paths/to/other/files.php --major where it pulls the current version from plugin.php, increments the major/minor/patch version as requested, and does a find and replace for the past version -> new version in the files listed, and prints out the changes.

I see a comment by @schlessera referencing WP_CLI\Utils\get_file_header(), but that doesn't seem to exist. I see the function seems to be I18n's FileDataExtractor.

  • Is there an existing command this should be a sub-command to?
  • Was get_file_header() ever in WP_CLI\Utils, i.e. was it moved out for any reason/is there any reason it cannot be moved there?
  • Any other suggestions on the name or parameters?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions