Generate a ZIP archive from a plugin folder, with optional metadata override and repository push. If a .wpcignore file is present in the plugin folder, it will be used to exclude files from the archive. See documentation for details.

Usage

wpc plugin:build [options] [--] [<input>]

Arguments

input
string
Input directory containing plugin sources (default: current working directory).

Options

--slug, -s
string
Plugin slug. If omitted, the working directory name will be used.
--output-dir, -o
string
default:"../dist"
Output directory for the ZIP archive.
--filename, -f
string
Name of the output ZIP file.
--header
string[]
Override one or more plugin headers (e.g. --header="Version=1.2.3").
Only existing headers in the plugin file will be replaced, new ones will be ignored. Original file will be unchanged.
--push, -p
boolean
Push the archive to the configured repository. See push documentation.
--message, -m
string
Release notes used during push (ignored without push option).
--clean
boolean
Delete the ZIP file after it has been uploaded (ignored without push option).

Examples

# Build a zip from current working directory
$ wpc plugin:build

# Build a zip by providing all directories and files name
$ wpc plugin:build --slug=my-plugin --output-dir=build --filename=my-plugin.zip my-plugin

# Build and push a zip with a specific version and with release notes
$ wpc plugin:build --header="Version=1.2.3" --push --m "Add new block"