fixed merge conflict

This commit is contained in:
Andrei Stoica 2024-02-22 01:34:11 -05:00
parent 62617473bd
commit 695e31c7e4
2 changed files with 19 additions and 2 deletions

View File

@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
chrono = "0.4.26"
clap = { version = "4.5.1", features = ["derive"] }
comrak = "0.18.0"
figment = { version = "0.10.10", features = ["env", "serde_json", "json"] }
regex = "1.8.4"

View File

@ -1,6 +1,10 @@
mod cli;
mod config;
mod todo;
use crate::cli::Args;
use clap::Parser;
use crate::config::Config;
use crate::todo::File as TodoFile;
use crate::todo::{Status as TaskStatus, TaskGroup};
@ -11,19 +15,29 @@ use comrak::{parse_document, Arena};
use comrak::{ComrakExtensionOptions, ComrakOptions, ComrakParseOptions};
use std::borrow::Borrow;
use std::collections::HashMap;
<<<<<<< Updated upstream
use std::env;
use std::fs::{create_dir_all, metadata, read, read_dir, File};
=======
use std::fs::{read, read_dir, File};
>>>>>>> Stashed changes
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;
use std::{env, str};
//TODO handle unwraps and errors more uniformly
//TODO refactor creating new file
//TODO clean up verbose printing
//TODO create custom errors for better error handling
//TODO Default path for note_dir should start with curent path not home
fn main() {
#[derive(Debug)]
enum ExitError {
ConfigError(String),
}
fn main() -> Result<(), ExitError> {
let expected_cfg_files = Config::expected_locations().unwrap();
println!("{:#?}", expected_cfg_files);
let cfg_files: Vec<&Path> = expected_cfg_files
@ -126,6 +140,8 @@ fn main() {
.args([current_file])
.status()
.expect(format!("failed to launch editor {}", "vim").as_str());
Ok(())
}
fn get_filepath(data_dir: &PathBuf, date: &NaiveDate) -> PathBuf {