krankerl 0.13.2

A CLI helper to manage Nextcloud apps
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fs;
use std::path::PathBuf;

use color_eyre::{eyre::WrapErr, Result};

pub fn clean(app_path: &PathBuf) -> Result<()> {
    let artifacts_path = app_path.join("build").join("artifacts");

    if artifacts_path.exists() {
        fs::remove_dir_all(artifacts_path).wrap_err("Failed to remove artifact directory")?;
        println!("Build directory cleaned.");
    } else {
        println!("Nothing to clean.");
    }
    Ok(())
}