fix(json-edit): with actual arg instead of stupid str replace
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -12,8 +12,6 @@ impl JsonEditOptions {
|
||||
pub fn execute(&self, path: &Path, next_version: impl AsRef<str>) -> anyhow::Result<()> {
|
||||
let next_version = next_version.as_ref();
|
||||
|
||||
let jq_query = self.jq.replace("%%version%%", next_version);
|
||||
|
||||
if !path.exists() {
|
||||
anyhow::bail!("could not find file at: {}", path.display());
|
||||
}
|
||||
@@ -30,7 +28,10 @@ impl JsonEditOptions {
|
||||
))?;
|
||||
|
||||
let output = std::process::Command::new("jq")
|
||||
.arg(format!("{}", jq_query))
|
||||
.arg("--arg")
|
||||
.arg("version")
|
||||
.arg(next_version)
|
||||
.arg(&self.jq)
|
||||
.arg(
|
||||
abs_path
|
||||
.to_str()
|
||||
|
Reference in New Issue
Block a user