ic-db-cli 0.34.2

Local fixture console for IC DB
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::{Path, PathBuf};

pub fn install(prefix: &Path) -> PathBuf {
    std::fs::create_dir(prefix).unwrap();
    std::fs::create_dir(prefix.join("bin")).unwrap();
    std::fs::create_dir_all(prefix.join("share/ic-db/m1")).unwrap();
    let binary = prefix.join("bin/db");
    std::fs::copy(env!("CARGO_BIN_EXE_db"), &binary).unwrap();
    std::fs::copy(
        std::env::var_os("IC_DB_M1_RECORDS_WASM").expect("build the console fixture"),
        prefix.join("share/ic-db/m1/records.wasm"),
    )
    .unwrap();
    binary
}