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

Usage

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

Arguments

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

Options

--slug, -s
string
Theme 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 theme headers (e.g. --header="Version=1.2.3"). Only existing headers in the theme 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 theme:build

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

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