From 3c104cb3aa3c1164e0337ea11cc7c41dbd5643e8 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Fri, 9 Aug 2019 11:31:42 -0700 Subject: [PATCH 1/7] 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/ From 0066fecc20ef0bd120ab732e70b4f9791328424a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 18 Sep 2019 17:06:40 -0400 Subject: [PATCH 2/7] Fix LESSC assignment in less/Makefile --- less/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/less/Makefile b/less/Makefile index 5e51b4d..85a64f3 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,4 +1,4 @@ -LESSC := $(shell command -v lessc 2> /dev/null) +LESSC=$(shell command -v lessc 2> /dev/null) ifndef LESSC $(error "less is not installed, please run install-less.sh") From d129894ba76e7b5a4850b9e3f98e39b4e8cd3242 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Wed, 18 Sep 2019 15:56:22 -0700 Subject: [PATCH 3/7] fix check for missing less --- less/Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/less/Makefile b/less/Makefile index 85a64f3..3484e29 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,15 +1,13 @@ -LESSC=$(shell command -v lessc 2> /dev/null) - -ifndef LESSC - $(error "less is not installed, please run install-less.sh") +ifeq (,$(shell command -v lessc 2> /dev/null)) +$(error "less is not installed, please run install-less.sh") endif CSSDIR=../static/css/ all : - $(LESSC) app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css - $(LESSC) fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css - $(LESSC) icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css + lessc app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css + lessc fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css + lessc icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css install : ./install-less.sh From 9d0027ec53506d35ede4d20b993e0ab198d66eea Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Fri, 20 Sep 2019 09:17:47 -0700 Subject: [PATCH 4/7] don't need less to install less --- less/Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/less/Makefile b/less/Makefile index 3484e29..3d0c4b2 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,12 +1,9 @@ -ifeq (,$(shell command -v lessc 2> /dev/null)) -$(error "less is not installed, please run install-less.sh") -endif - CSSDIR=../static/css/ all : - lessc app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css - lessc fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css + ifeq (,$(shell command -v lessc 2> /dev/null)) + $(error "less is not installed, please run install-less.sh") + endif lessc icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css install : From 43849d95d301bab16a15b92ba6eb658d1c9c1ea8 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Fri, 20 Sep 2019 10:06:49 -0700 Subject: [PATCH 5/7] add back all generation steps accidentally removed two lines from make all fix check when trying to install lessc --- less/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/less/Makefile b/less/Makefile index 3d0c4b2..da6be71 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,9 +1,11 @@ CSSDIR=../static/css/ all : - ifeq (,$(shell command -v lessc 2> /dev/null)) - $(error "less is not installed, please run install-less.sh") - endif +ifeq (,$(shell command -v lessc 2> /dev/null)) +$(error "less is not installed, please run install-less.sh") +endif + lessc app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css + lessc fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css lessc icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css install : From cb78fd227ecb2deba835cb423a6153e89c842cca Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Fri, 20 Sep 2019 10:17:58 -0700 Subject: [PATCH 6/7] use inline bash instead --- less/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/less/Makefile b/less/Makefile index da6be71..1278c0a 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,9 +1,7 @@ CSSDIR=../static/css/ all : -ifeq (,$(shell command -v lessc 2> /dev/null)) -$(error "less is not installed, please run install-less.sh") -endif + @command -v lessc >/dev/null 2>&1 || { echo >&2 "less is not installed, please run install-less.sh."; exit 1; } lessc app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css lessc fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css lessc icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css From a01e2808906fb77db8516fcb393f9d8f009704b8 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 20 Sep 2019 18:22:01 -0400 Subject: [PATCH 7/7] Tweak "LESS not installed" message --- less/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/less/Makefile b/less/Makefile index 1278c0a..117e9b2 100644 --- a/less/Makefile +++ b/less/Makefile @@ -1,7 +1,7 @@ CSSDIR=../static/css/ all : - @command -v lessc >/dev/null 2>&1 || { echo >&2 "less is not installed, please run install-less.sh."; exit 1; } + @command -v lessc >/dev/null 2>&1 || { echo >&2 "lessc is not installed, please run: make install or: less/install-less.sh"; exit 1; } lessc app.less --clean-css="--s1 --advanced" $(CSSDIR)write.css lessc fonts.less --clean-css="--s1 --advanced" $(CSSDIR)fonts.css lessc icons.less --clean-css="--s1 --advanced" $(CSSDIR)icons.css