Skip to content

Commit 496f59e

Browse files
committed
fix(r2x-python): add branch to produce stdout if any SYSTEM step was registered.
1 parent 1f35f56 commit 496f59e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/r2x-python/src/plugin_invoker/upgrader.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl Bridge {
132132

133133
let mut system_data: Option<pyo3::Py<PyAny>> = None;
134134
let mut system_json_path: Option<PathBuf> = None;
135+
let mut saw_system_step = false;
135136

136137
for step in steps.try_iter()? {
137138
let step_obj = step.map_err(|e| BridgeError::Python(format!("{}", e)))?;
@@ -162,6 +163,7 @@ impl Bridge {
162163
));
163164

164165
let data_arg = if upgrade_is_system {
166+
saw_system_step = true;
165167
if system_data.is_none() {
166168
let resolved =
167169
resolve_system_json_path(&path_buf).map_err(BridgeError::Python)?;
@@ -228,6 +230,13 @@ impl Bridge {
228230
}
229231
}
230232

233+
if !saw_system_step {
234+
logger::debug(
235+
"Upgrader executed only FILE steps; skipping system.json resolution and returning empty output",
236+
);
237+
return Ok(String::new());
238+
}
239+
231240
let final_json_path = if let Some(json_path) = system_json_path {
232241
if let Some(ref data) = system_data {
233242
write_system_data(py, &dumps, data, &json_path)?;

0 commit comments

Comments
 (0)