From 29963f46048d99d6d4ef018ca8d5d30aa93c3545 Mon Sep 17 00:00:00 2001 From: Sayanee Date: Sun, 28 Jan 2024 13:32:14 +0800 Subject: [PATCH] feat: add a Makefile task to move 1 draft to post --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cc7468a..036c8d0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help serve install draft update leftover +.PHONY: help serve install draft update leftover move_draft default: serve @@ -24,3 +24,8 @@ leftover: rounded_months=$$(echo $$months_left | awk '{print int($$1+0.99)}'); \ echo "Current drafts: $$current_drafts"; \ echo "Approximately $$rounded_months months left at 1 draft per week." + +move_draft: + @file_to_move=$$(ls -1 _drafts | sort | head -n 1); \ + mv _drafts/$$file_to_move _posts/; \ + echo "Moved file: $$file_to_move"