znap-cli 0.1.37

Manage your znap workspaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::utils::{build_for_release, generate_collection_executable_files, get_config};

pub fn run(name: &str) {
    let config = get_config();
    let collections = config.collections.as_deref().unwrap_or_default();
    let collection = collections
        .iter()
        .find(|collection| collection.name == *name);

    if let Some(collection) = collection {
        generate_collection_executable_files(&config, collection);

        build_for_release(name);
    } else {
        panic!("Collection not found in the workspace.")
    }
}