znap-cli 0.1.37

Manage your znap workspaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::utils::get_cwd;
use std::fs::{create_dir, remove_dir_all, File};

pub fn run() {
    let znap_path = get_cwd().join(".znap");
    let znap_gitkeep_path = znap_path.join(".gitkeep");

    // Remove the current .znap folder and its content
    remove_dir_all(&znap_path).expect("Should be able to remove .znap folder");

    // Create a new .znap folder with a .gitkeep
    create_dir(&znap_path).expect("Should be able to create a .znap folder");
    File::create(znap_gitkeep_path).expect("Should be able to create a .znap/.gitkeep file");
}