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.
This commit is contained in:
Rob Loranger 2019-08-09 11:31:42 -07:00
parent 8557119451
commit 3c104cb3aa
No known key found for this signature in database
GPG Key ID: D6F1633A4F0903B8
1 changed files with 4 additions and 9 deletions

View File

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