diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-02-20 13:56:40 -0600 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-02-20 19:56:40 +0000 |
commit | eaf9ded18201d8ad2587860ed98763ca040f0b71 (patch) | |
tree | bea069efc098a3e7d4beeffb9abaaf26c09f47f3 /Makefile | |
parent | eea1155afe0fa3b1bbafe91504c9342f9a69245a (diff) | |
download | gitea-eaf9ded18201d8ad2587860ed98763ca040f0b71.tar.gz gitea-eaf9ded18201d8ad2587860ed98763ca040f0b71.zip |
Makefile changes for Windows and easier development (#6103)
* Added Go Path and node_modules to PATH
* Uses npx now for generate-stylesheets
* Uses `go env GOPATH` to calculate adding GOPATH/bin to PATH
* Added note about installing Node 8.0+ to generate stylesheets
* Added preferred Node version to CONTRIBUTING.md
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -4,6 +4,8 @@ IMPORT := code.gitea.io/gitea GO ?= go SED_INPLACE := sed -i +export PATH := $($(GO) env GOPATH)/bin:$(PATH) + ifeq ($(OS), Windows_NT) EXECUTABLE := gitea.exe else @@ -365,10 +367,14 @@ stylesheets-check: generate-stylesheets .PHONY: generate-stylesheets generate-stylesheets: + @hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + echo "Please install npm version 5.2+"; \ + exit 1; \ + fi; $(eval BROWSERS := "> 2%, last 2 firefox versions, last 2 safari versions") - node_modules/.bin/lessc --clean-css public/less/index.less public/css/index.css - $(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),node_modules/.bin/lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) - $(foreach file, $(wildcard public/css/*),node_modules/.bin/postcss --use autoprefixer --autoprefixer.browsers $(BROWSERS) -o $(file) $(file);) + npx lessc --clean-css public/less/index.less public/css/index.css + $(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) + $(foreach file, $(wildcard public/css/*),npx postcss --use autoprefixer --autoprefixer.browsers $(BROWSERS) -o $(file) $(file);) .PHONY: swagger-ui swagger-ui: |