From 3c104cb3aa3c1164e0337ea11cc7c41dbd5643e8 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Fri, 9 Aug 2019 11:31:42 -0700 Subject: [PATCH] check for lessc executable in any location previously the checks were explicit locations which does not work when using something like nvm to manage node packages and versions. this checks for the executable and sets the script variable LESSC to the full path of the one found. if none was found the make command will error. --- less/Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/less/Makefile b/less/Makefile index e81258a..5e51b4d 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,13 +1,8 @@ -ifeq ($(shell which lessc),/usr/bin/lessc) - LESSC=/usr/bin/lessc -else ifeq ($(shell which lessc),/usr/local/bin/lessc) - LESSC=/usr/local/bin/lessc -else ifeq ($(shell which lessc),/bin/lessc) - LESSC=/bin/lessc -else - LESSC=node_modules/.bin/lessc +LESSC := $(shell command -v lessc 2> /dev/null) + +ifndef LESSC + $(error "less is not installed, please run install-less.sh") endif -export LESSC CSSDIR=../static/css/