Function serde_yml::utilities::directory::move_output_directory
source · pub fn move_output_directory(site_name: &str, out_dir: &Path) -> Result<()>
Expand description
Moves the output directory to the public directory.
This function takes a reference to a Path
object for the output directory
and a string for the site name, and moves the output directory to the
public directory.
§Arguments
site_name
- A string for the site name.out_dir
- A reference to aPath
object for the output directory.
§Returns
Result<(), std::io::Error>
- A result indicating success or failure.Ok(())
if the output directory was moved successfully.Err(std::io::Error)
if the output directory could not be moved.
§Example
use serde_yml::utilities::directory::move_output_directory;
use std::path::Path;
let site_name = "My Website";
let out_dir = Path::new("output");
match move_output_directory(site_name, out_dir) {
Ok(()) => println!("Output directory moved successfully."),
Err(e) => eprintln!("Error moving output directory: {}", e),
}