Skip to content

Commit

Permalink
fix: create config file on --open-config if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cestef committed Jun 21, 2024
1 parent 15ef72d commit 3c301e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ async fn main() -> Result<()> {
},
|e| Ok(PathBuf::from(e)),
)?;
if !path.exists() {
// Create the file if it doesn't exist
tokio::fs::write(&path, "").await?;
log::debug!("Created config file: {}", path.display());
}
log::debug!("Opening config file: {}", path.display());
utils::open_file(&path)?;
process::exit(0);
Expand Down

0 comments on commit 3c301e5

Please sign in to comment.