Skip to content

Commit 81ffbc1

Browse files
committed
fix: check less command exist.
1 parent bcd69e7 commit 81ffbc1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ all: build
4040
.PHONY: clean
4141
clean:
4242
go clean -i ./...
43-
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA)
43+
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) public/css/index.css
4444

4545
.PHONY: fmt
4646
fmt:
@@ -186,14 +186,18 @@ stylesheets: public/css/index.css
186186

187187
.IGNORE: public/css/index.css
188188
public/css/index.css: $(STYLESHEETS)
189-
lessc $< $@
189+
@hash lessc > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
190+
docker run --rm -v $(PWD):/app appleboy/node-less $< $@; \
191+
else \
192+
lessc $< $@; \
193+
fi
190194

191195
.PHONY: swagger-ui
192196
swagger-ui:
193-
rm -Rf public/assets/swagger-ui
197+
rm -rf public/assets/swagger-ui
194198
git clone --depth=10 -b v3.0.7 --single-branch https://github.com/swagger-api/swagger-ui.git /tmp/swagger-ui
195199
mv /tmp/swagger-ui/dist public/assets/swagger-ui
196-
rm -Rf /tmp/swagger-ui
200+
rm -rf /tmp/swagger-ui
197201
sed -i "s;http://petstore.swagger.io/v2/swagger.json;../../swagger.v1.json;g" public/assets/swagger-ui/index.html
198202

199203
.PHONY: assets

0 commit comments

Comments
 (0)