multiversx_sc_meta_lib/contract/sc_config/
wasm_update.rs

1use std::process::Command;
2
3use super::ContractVariant;
4
5impl ContractVariant {
6    /// Runs `cargo update` in the corresponding wasm crate.
7    pub fn cargo_update(&self) {
8        let exit_status = Command::new("cargo")
9            .args(["update"])
10            .current_dir(self.wasm_crate_path())
11            .spawn()
12            .expect("failed to spawn contract update process")
13            .wait()
14            .expect("contract update process was not running");
15
16        assert!(exit_status.success(), "contract update process failed");
17    }
18}