updateVersion
Updates the version of the project based on the specified update type.
This function performs a series of tasks to handle version updates: 1. Validates the version update type. 2. Checks if Git and GitHub CLI are installed. 3. Verifies that the interactive changelog review, if one is due, can actually be answered. 4. Verifies that the Git repository is clean. 5. Runs spellcheck and linting. 6. Builds the project. 7. Settles the changelog — the only step that can block on a human, and deliberately the last one before anything is written, so an interrupt here leaves the working tree clean and the release re-runnable. 8. Updates version in files, then writes the settled changelog. 9. Adds updated files to Git, tags the commit, and pushes to the repository. 10. If an Obsidian plugin, copies the updated manifest and publishes a GitHub release.
Import:
import { updateVersion } from 'obsidian-dev-utils/script-utils/version';Signature:
function updateVersion(versionUpdateType: string | undefined, options: UpdateVersionOptions): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
versionUpdateType | string | undefined | The type of version update to perform (major, minor, patch, premajor, preminor, prepatch, prerelease, or x.y.z[-suffix]). |
options | UpdateVersionOptions | The UpdateVersionOptions controlling the release behavior. |
Returns: Promise<void> — A Promise that resolves when the version update is complete.
Links to this page: