Skip to content

Commit

Permalink
Update dg.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
t-aleksander committed Dec 20, 2024
1 parent 5aaefc0 commit 6607a8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src-tauri/cli/src/bin/dg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ async fn main() {

let matches = command!()
.arg(config_opt)
.arg_required_else_help(true)
.arg_required_else_help(false)
.propagate_version(true)
.subcommand_required(false)
.subcommand(
Expand All @@ -429,13 +429,14 @@ async fn main() {
Some(path) => path.clone(),
None => {
if let Some(mut path) = dirs_next::data_dir() {
path.push("net.defguard.cli/config.json");
path.push("net.defguard.cli");
if !path.exists() {
if let Err(err) = create_dir(&path) {
eprintln!("Failed to create default configuration path: {err}");
return;
}
}
path.push("config.json");
path
} else {
eprintln!("Default configuration path is not available on this platform. Please, specify it explicitly.");
Expand Down

0 comments on commit 6607a8f

Please sign in to comment.