make: create a new file

- Creates a templates and a notes directory.
- Fixes #9.

Co-Authored-by: iGor milhit <igor@milhit.ch>
iGor milhit 2022-12-21 21:07:22 +01:00
parent a388b69b41
commit 7a62ee2f91
Signed by: igor
GPG Key ID: 692D97C3D0228A99
3 changed files with 22 additions and 0 deletions

View File

@ -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)

6
notes/default.md 100644
View File

@ -0,0 +1,6 @@
---
date:
id:
---

View File

@ -0,0 +1,6 @@
---
date:
id:
---