From 7a62ee2f91ff4287981f7e6a6db886cd46769e59 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Wed, 21 Dec 2022 21:07:22 +0100 Subject: [PATCH] make: create a new file - Creates a templates and a notes directory. - Fixes #9. Co-Authored-by: iGor milhit --- Makefile | 10 ++++++++++ notes/default.md | 6 ++++++ templates/default.md | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 notes/default.md create mode 100644 templates/default.md diff --git a/Makefile b/Makefile index 366854f..5565e5a 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ pandoc=$(shell command -v pandoc) pandoc_version=$(shell pandoc --version | sed -e 's/.* // ; 1q') awk=$(shell command -v awk) +templates_directory="./templates" +notes_directory="./notes" + .PHONY: help deps help: ## Display this help @@ -27,3 +30,10 @@ ifeq ($(strip ($awk)),) else @echo "awk is installed" endif + +new: ## Create a new file + $(info Creating a new file) + date=$(shell date +%Y) + name=$(date).md + @echo $(name) + cp $(templates_directory)/default.md $(notes_directory)/$(name) diff --git a/notes/default.md b/notes/default.md new file mode 100644 index 0000000..1921555 --- /dev/null +++ b/notes/default.md @@ -0,0 +1,6 @@ +--- +date: +id: +--- + + diff --git a/templates/default.md b/templates/default.md new file mode 100644 index 0000000..1921555 --- /dev/null +++ b/templates/default.md @@ -0,0 +1,6 @@ +--- +date: +id: +--- + +