multiversx_sc_meta_lib/contract/sc_config/
wasm_update.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::process::Command;

use super::ContractVariant;

impl ContractVariant {
    /// Runs `cargo update` in the corresponding wasm crate.
    pub fn cargo_update(&self) {
        let exit_status = Command::new("cargo")
            .args(["update"])
            .current_dir(self.wasm_crate_path())
            .spawn()
            .expect("failed to spawn contract update process")
            .wait()
            .expect("contract update process was not running");

        assert!(exit_status.success(), "contract update process failed");
    }
}