From 5aeb4c8d7a739b355e73381c0eef8683ac877deb Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Fri, 21 Mar 2025 12:46:31 -0500 Subject: [PATCH] wip --- src/install.rs | 7 +++++++ src/main.rs | 12 +++--------- 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 src/install.rs diff --git a/src/install.rs b/src/install.rs new file mode 100644 index 0000000..4ae1ecf --- /dev/null +++ b/src/install.rs @@ -0,0 +1,7 @@ +use crate::prelude::*; + +pub(crate) fn main() -> Result<(), AppError> { + let path = app_common::try_config_dir().unwrap().join("server.ini"); + + Ok(()) +} diff --git a/src/main.rs b/src/main.rs index 28f109c..c10a911 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,13 +40,7 @@ async fn async_main() -> Result<(), AppError> { Ok(()) } "find-nick" => client::find_nick(args).await, - "install" => { - let Some(nickname) = args.next() else { - eprintln!("Usage: lookaround install "); - return Err(CliArgError::MissingArgumentValue("install".into()).into()); - }; - install::main(&nickname) - } + "install" => install::main(), "my-ips" => my_ips(), "server" => server::server(args).await, x => Err(CliArgError::UnknownSubcommand(x.to_string()).into()), @@ -54,8 +48,8 @@ async fn async_main() -> Result<(), AppError> { } fn config() { - if let Some(proj_dirs) = directories::ProjectDirs::from("", "ReactorScram", "LookAround") { - println!("Using config dir {:?}", proj_dirs.config_local_dir()); + if let Some(dir) = app_common::try_config_dir() { + println!("config dir = `{dir:?}`"); } else { println!("Can't detect config dir."); }