macro_rules! macro_cleanup_directories {
    ( $( $_dir:expr ),* ) => { ... };
}
Expand description

§macro_cleanup_directories Macro

Cleanup multiple directories by invoking the cleanup_directory function.

§Usage

use std::path::Path;
use libmake::macro_check_directory;

let path = Path::new("logs");
macro_check_directory!(path, "logs");

§Arguments

  • $( $_dir:expr ),* - A comma-separated list of directory paths to clean up.

§Behaviour

The macro_cleanup_directories macro takes multiple directory paths as arguments and invokes the cleanup_directory function for each path. It is assumed that the cleanup_directory function is available in the crate’s utilities module ($crate::utilities::cleanup_directory).

The macro creates an array directories containing the provided directory paths and passes it as an argument to cleanup_directory. The cleanup_directory function is responsible for performing the cleanup operations.

Please note that the macro uses the ? operator for error propagation. It expects the cleanup_directory function to return a Result type. If an error occurs during the cleanup process, it will be propagated up the call stack, allowing the caller to handle it appropriately.

§See Also

  • macro_check_directory for checking and creating a single directory
  • [macro_create_directories] for creating multiple directories