Skip to content

Commit 2cf6572

Browse files
authored
Merge branch 'main' into feat/version
2 parents a1e3c3d + fbf60ad commit 2cf6572

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

crates/stellar-scaffold-cli/src/commands/build/clients.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,23 @@ export default new Client.Client({{
376376
// No existing directory, just move temp to final location
377377
std::fs::rename(&temp_dir, &final_output_dir)?;
378378
printer.checkln(format!("Client {name:?} created successfully"));
379+
// Run npm install in the final output directory to ensure proper linking
380+
let output = std::process::Command::new("npm")
381+
.current_dir(&final_output_dir)
382+
.arg("install")
383+
.arg("--loglevel=error")
384+
.output()?;
385+
386+
if !output.status.success() {
387+
return Err(Error::NpmCommandFailure(
388+
final_output_dir.clone(),
389+
format!(
390+
"npm install in final directory failed with status: {:?}\nError: {}",
391+
output.status.code(),
392+
String::from_utf8_lossy(&output.stderr)
393+
),
394+
));
395+
}
379396
}
380397

381398
self.create_contract_template(name, contract_id)?;

crates/stellar-scaffold-cli/tests/it/build_clients/contracts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ STELLAR_ACCOUNT=bob --symbol ABND --decimal 7 --name abundance --admin bb
451451
assert!(stderr.contains("Failures:"));
452452

453453
// Should show specific failure details for token contract
454-
assert!(stderr.contains("soroban_token_contract - Error:"));
454+
assert!(stderr.contains("soroban_token_contract:"));
455455

456456
// Should still process successful contracts
457457
assert!(

0 commit comments

Comments
 (0)