Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.33 KB

toml.md

File metadata and controls

63 lines (44 loc) · 1.33 KB

TOML File Replacer

If you specify a TOML File Replacer, it will parse the TOML file specified and replace the key with the new version. Nested keys are supported using ..

Example 1: Cargo.toml

If you specify the following in your .semver config file:

file_replacers:
  - type: toml
    name: Cargo.toml
    key: version
    format: "v%M.%m.%p"

Given the following contents for Cargo.toml:

name = "my package"
version = "v0.0.0"

When creating v1.0.0, the PageKey Semver will replace the Cargo.toml with the following:

name = "my package"
version = "v1.0.0"

Note that the value will always be replaced with the format you specified in the config, regardless of the previous value.

Example 2: Nested Keys

If you specify the following in your .semver config file:

file_replacers:
  - type: toml
    name: Cargo.toml
    key: project.metadata.version
    format: "v%M.%m.%p"

Given the following contents for Cargo.toml:

name = "my package"

[project.metadata]
version = "v0.0.0"

When creating v1.0.0, the PageKey Semver will replace the package.json with the following:

name = "my package"

[project.metadata]
version = "v1.0.0"

Note that the value will always be replaced with the format you specified in the config, regardless of the previous value.