Skip to content

Commit

Permalink
Makefile: split draft/undraft in a separate cd ... && mv ... call
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 14, 2024
1 parent 4742f83 commit 7853d71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ post: blog day
TITLE = $(error FILE is not defined)
.PHONY: draft
draft:
mv '$(FILE)' '$(dir $(FILE)).$(notdir $(FILE))'
cd '$(dir $(FILE))' && mv '$(notdir $(FILE))' '.$(notdir $(FILE))'

.PHONY: undraft
undraft:
mv '$(FILE)' '$(dir $(FILE))$(patsubst .%,%,$(notdir $(FILE)))'

cd '$(dir $(FILE))' && mv '$(notdir $(FILE))' '$(patsubst .%,%,$(notdir $(FILE)))'

.PHONY: clean
clean:
Expand Down

0 comments on commit 7853d71

Please sign in to comment.