From 0d8179e163ce6f8dc45dee23d1270da52c293f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20Argos=29?= Date: Sat, 14 Jan 2023 08:13:57 +0100 Subject: [PATCH] Set emacs binary depending on the OS. Only works with Linux and Darwin. --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a68bcad..1e7bf65 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,22 @@ all: publish assets clean +OS := $(shell uname -s) +ARCH := $(shell uname -p) + +ifeq ($(OS), Linux) + EMACS=emacs +endif +ifeq ($(OS),Darwin) + ifeq ($(ARCH), arm) + EMACS=/opt/homebrew/bin/emacs + else + EMACS=/usr/local/opt/emacs + endif +endif + publish: - @emacs --batch --no-init --load publish.el --funcall org-publish-all + @EMACS --batch --no-init --load publish.el --funcall org-publish-all sed -i '/‎<\/title>/d' ./output/index.html sed -i '/<title>‎<\/title>/d' ./output/research/index.html sed -i '/<title>‎<\/title>/d' ./output/posts/index.html