Replace TOML table row

Apache 2.0

Replace a TOML table row with new content. If a row with the same identifying property exists, replace it entirely.

org.openrewrite.toml.ReplaceTableRow

Required

The name of the TOML array table to replace rows in (e.g., 'package.contributors').

The TOML key-value pairs to replace with. Should contain the objectIdentifyingProperty.

The property name used to match existing rows. When a row with this property value exists, it will be replaced; otherwise, a new row will not be inserted (see MergeTableRow).

mod run . --recipe=org.openrewrite.toml.ReplaceTableRow \ -P tableName=package.contributors \ -P row='name = "Alice Smith"\nemail = "alice@example.com"' \ -P identifyingKey=name

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.