|
|
@ -27,15 +27,20 @@ pub fn generate(verbose: bool) {
|
|
|
|
|
|
|
|
|
|
|
|
info!("Generating repository: {}", name);
|
|
|
|
info!("Generating repository: {}", name);
|
|
|
|
|
|
|
|
|
|
|
|
// If repository exists, delete it
|
|
|
|
// If repository exists, empty it
|
|
|
|
if Path::exists(name.as_ref()) {
|
|
|
|
if Path::exists(name.as_ref()) {
|
|
|
|
log!(verbose, "Deleting {}", name);
|
|
|
|
log!(verbose, "Deleting contents of {}", name);
|
|
|
|
fs::remove_dir_all(&name).unwrap();
|
|
|
|
Command::new("bash")
|
|
|
|
}
|
|
|
|
.args(&["-c", &format!("rm -rf {}/*", &name)])
|
|
|
|
|
|
|
|
.spawn()
|
|
|
|
// Create or recreate repository directory
|
|
|
|
.unwrap()
|
|
|
|
|
|
|
|
.wait()
|
|
|
|
|
|
|
|
.unwrap(); // Dirty temp hack but oh well
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Create dir if it doesn't exist
|
|
|
|
fs::create_dir_all(&name).unwrap();
|
|
|
|
fs::create_dir_all(&name).unwrap();
|
|
|
|
log!(verbose, "Created {}", name);
|
|
|
|
log!(verbose, "Created {}", name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Copy out packages to repository directory
|
|
|
|
// Copy out packages to repository directory
|
|
|
|
Command::new("bash")
|
|
|
|
Command::new("bash")
|
|
|
|