//! Clean the public directory

use anyhow::Result;
use std::fs;

use crate::Hexo;

/// Clean the public directory
pub fn run(hexo: &Hexo) -> Result<()> {
    if hexo.public_dir.exists() {
        fs::remove_dir_all(&hexo.public_dir)?;
        tracing::info!("Deleted: {:?}", hexo.public_dir);
    }

    Ok(())
}
