-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 692 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.DEFAULT_GOAL := stylua-run
ifeq ($(shell uname -s),Darwin)
UNAME ?= MACOS
else
UNAME ?= LINUX
endif
STYLUA_PLATFORM_MACOS := macos-aarch64
STYLUA_PLATFORM_LINUX := linux-x86_64
STYLUA_PLATFORM := $(STYLUA_PLATFORM_$(UNAME))
STYLUA_VERSION := v0.18.2
STYLUA_ZIP := stylua-$(STYLUA_PLATFORM).zip
STYLUA_URL_BASE := https://github.com/JohnnyMorganz/StyLua/releases/download
STYLUA_URL := $(STYLUA_URL_BASE)/$(STYLUA_VERSION)/$(STYLUA_ZIP)
.INTERMEDIATE: $(STYLUA_ZIP)
$(STYLUA_ZIP):
wget $(STYLUA_URL)
stylua: $(STYLUA_ZIP)
unzip $<
.PHONY: stylua-check
stylua-check: stylua
./stylua --check lua/**/*.lua
.PHONY: stylua-run
stylua-run: stylua
./stylua lua/**/*.lua lua/*.lua