multiversx_sc_meta_lib/contract/sc_config/
wasm_clean.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 clean` in the corresponding wasm crate.
    pub fn cargo_clean(&self) {
        let exit_status = Command::new("cargo")
            .args(["clean"])
            .current_dir(self.wasm_crate_path())
            .spawn()
            .expect("failed to spawn contract clean process")
            .wait()
            .expect("contract clean process was not running");

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