Navigation Menu

Skip to content

Commit

Permalink
moved to slugifying filesnames
Browse files Browse the repository at this point in the history
  • Loading branch information
tshepang committed Jul 13, 2020
1 parent 126c4ac commit 0f05b83
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -8,3 +8,4 @@ edition = "2018"
dirs = "3"
structopt = "0.3"
chrono = "0.4"
slug = "0.1"
3 changes: 2 additions & 1 deletion src/main.rs
@@ -1,4 +1,5 @@
use dirs::home_dir;
use slug::slugify;
use std::{fs, io, process};
use structopt::StructOpt;

Expand Down Expand Up @@ -35,7 +36,7 @@ tags = {:?}{}
}
);
let output = output.trim();
let path = dir.join(cli.title).with_extension("md");
let path = dir.join(slugify(cli.title)).with_extension("md");
eprintln!("{}", path.display());
if path.exists() {
eprintln!("path exists already, opening ...");
Expand Down

0 comments on commit 0f05b83

Please sign in to comment.