mirror of
https://git.sr.ht/~nixgoat/vento
synced 2025-11-30 08:27:17 +00:00
archive: Reword Vento directory archives
Calling the action of archiving the Vento directory "Archiving Vento installs" was a bit misleading, so I changed it to Vento directories.
This commit is contained in:
parent
2a4ee258a3
commit
d148a96e06
|
|
@ -54,7 +54,7 @@ pub fn export_inv(slot: &str, output: PathBuf, message: bool) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn export_install(output: PathBuf, message: bool) -> Result<()> {
|
pub fn export_dir(output: PathBuf, message: bool) -> Result<()> {
|
||||||
let dir: PathBuf = common::env_config()?.vento_dir;
|
let dir: PathBuf = common::env_config()?.vento_dir;
|
||||||
|
|
||||||
let archive = File::create(&output)?;
|
let archive = File::create(&output)?;
|
||||||
|
|
@ -65,7 +65,7 @@ pub fn export_install(output: PathBuf, message: bool) -> Result<()> {
|
||||||
if message {
|
if message {
|
||||||
println!(
|
println!(
|
||||||
"✅ {} {}",
|
"✅ {} {}",
|
||||||
"Exported Vento install into".green(),
|
"Exported Vento directory into".green(),
|
||||||
&output.to_str().unwrap()
|
&output.to_str().unwrap()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -102,7 +102,7 @@ pub fn import_inv(input: PathBuf, slot: &str, message: bool) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn import_install(input: PathBuf, message: bool) -> Result<()> {
|
pub fn import_dir(input: PathBuf, message: bool) -> Result<()> {
|
||||||
let dir: PathBuf = common::env_config()?.vento_dir;
|
let dir: PathBuf = common::env_config()?.vento_dir;
|
||||||
|
|
||||||
let tar_xz = File::open(&input)?;
|
let tar_xz = File::open(&input)?;
|
||||||
|
|
@ -115,7 +115,7 @@ pub fn import_install(input: PathBuf, message: bool) -> Result<()> {
|
||||||
"✅ {} {} {}",
|
"✅ {} {} {}",
|
||||||
"Imported".green(),
|
"Imported".green(),
|
||||||
&input.to_str().unwrap(),
|
&input.to_str().unwrap(),
|
||||||
"into Vento install".green(),
|
"into Vento directory".green(),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ fn main() -> Result<()> {
|
||||||
2 => archive::export_inv("active", PathBuf::from("active.tar.xz"), true)?,
|
2 => archive::export_inv("active", PathBuf::from("active.tar.xz"), true)?,
|
||||||
_ => throw_error(ErrorType::TooManyArgs)?,
|
_ => throw_error(ErrorType::TooManyArgs)?,
|
||||||
},
|
},
|
||||||
"-E" | "--export-install" => match args.len() {
|
"-E" | "--export-dir" => match args.len() {
|
||||||
3 => archive::export_install(PathBuf::from(&args[2]), true)?,
|
3 => archive::export_dir(PathBuf::from(&args[2]), true)?,
|
||||||
2 => archive::export_install(PathBuf::from("vento.tar.xz"), true)?,
|
2 => archive::export_dir(PathBuf::from("vento.tar.xz"), true)?,
|
||||||
_ => throw_error(ErrorType::TooManyArgs)?,
|
_ => throw_error(ErrorType::TooManyArgs)?,
|
||||||
},
|
},
|
||||||
"-g" | "--import-inv" => match args.len() {
|
"-g" | "--import-inv" => match args.len() {
|
||||||
|
|
@ -71,8 +71,8 @@ fn main() -> Result<()> {
|
||||||
2 => throw_error(ErrorType::SpecifyFile)?,
|
2 => throw_error(ErrorType::SpecifyFile)?,
|
||||||
_ => throw_error(ErrorType::TooManyArgs)?,
|
_ => throw_error(ErrorType::TooManyArgs)?,
|
||||||
},
|
},
|
||||||
"-G" | "--import-install" => match args.len() {
|
"-G" | "--import-dir" => match args.len() {
|
||||||
3 => archive::import_install(PathBuf::from(&args[2]), true)?,
|
3 => archive::import_dir(PathBuf::from(&args[2]), true)?,
|
||||||
2 => throw_error(ErrorType::SpecifyFile)?,
|
2 => throw_error(ErrorType::SpecifyFile)?,
|
||||||
_ => throw_error(ErrorType::TooManyArgs)?,
|
_ => throw_error(ErrorType::TooManyArgs)?,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue