xenoterracide / brix

Brix is a CLI tool written in Rust for scaffolding and code generation.
https://crates.io/crates/brix
MIT License
5 stars 0 forks source link

search/replace #10

Open xenoterracide opened 3 years ago

xenoterracide commented 3 years ago

tempted to name the command sed because what I'm thinking of is referred to as a sed patch.

note: I'm not sure of the exact invocation for a platform-agnostic line ending in rust

commands:
- search_replace:
    dest: settings.gradle.kts
    search: '^include\($'
    replace: '%n":{{foo}}"%n,'
    context:
       foo: bar

which would allow

include(
  ":app",
)

to then become

include(
  ":bar",
  ":app",
)