feat(desktop): add per-instance desktop shortcut toggle
This commit is contained in:
1 parent
3047086fa2
commit
e18b18c0be
9 files changed
+172
-5
No files matched your search
@@ -17,6 +17,7 @@ pub async fn handle_instance(matches: &ArgMatches) -> CliResult {
|
||||
Some(("rename", sub_matches)) => rename_instance(sub_matches),
|
||||
Some(("launch", sub_matches)) => launch_instance(sub_matches).await,
|
||||
Some(("config", sub_matches)) => config_instance(sub_matches),
|
||||
Some(("desktop", sub_matches)) => desktop_instance(sub_matches),
|
||||
_ => Ok(()),
|
||||
}
|
||||
}
|
||||
@@ -153,6 +154,18 @@ async fn launch_instance(matches: &ArgMatches) -> CliResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn desktop_instance(matches: &ArgMatches) -> CliResult {
|
||||
let name = required_arg(matches, "name")?;
|
||||
let config = manager().load_one(name)?;
|
||||
let enabled = crate::instance::desktop::toggle(&config)?;
|
||||
if enabled {
|
||||
println!("Desktop shortcut created for '{}'.", name);
|
||||
} else {
|
||||
println!("Desktop shortcut removed for '{}'.", name);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn config_instance(matches: &ArgMatches) -> CliResult {
|
||||
let name = required_arg(matches, "name")?;
|
||||
let manager = manager();
|
||||
|
||||
Reference in new issue
Block a user