feat: add streamd lsp subcommand with LSP server #90
1 changed files with 8 additions and 1 deletions
|
|
@ -65,7 +65,14 @@ pub fn run(date: Option<String>) -> Result<(), StreamdError> {
|
|||
Command::new(&editor).arg(file_path).status()?;
|
||||
} else {
|
||||
let now_local = Utc::now().with_timezone(&tz);
|
||||
let file_name = now_local.format("%Y%m%d-%H%M%S_daily.md").to_string();
|
||||
let file_timestamp = if target_date == now_local.date_naive() {
|
||||
now_local
|
||||
} else {
|
||||
tz.from_local_datetime(&NaiveDateTime::new(target_date, NaiveTime::MIN))
|
||||
.earliest()
|
||||
.unwrap()
|
||||
};
|
||||
let file_name = file_timestamp.format("%Y%m%d-%H%M%S_daily.md").to_string();
|
||||
let file_path = base_folder.join(&file_name);
|
||||
fs::write(&file_path, "# ")?;
|
||||
Command::new(&editor).arg(&file_path).status()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue