-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (37 loc) · 1.28 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
SHFMT_VERSION := v3.8.0
.PHONY: setuppc
setuppc:
@echo "Setting up pre-commit and hooks..."
python3 -m pip install pre-commit
pre-commit install
ifeq ($(shell uname),Darwin)
@echo "Setting up shfmt (macOS)..."
brew install shfmt
@echo "Setting up shellcheck (macOS)..."
brew install shellcheck
else ifeq ($(shell uname -s),Linux)
ifeq ($(shell uname -m),x86_64)
@echo "Setting up shfmt for amd64 (Linux)..."
wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64"
else ifeq ($(shell uname -m),aarch64)
@echo "Setting up shfmt for arm64 (Linux)..."
wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_arm64"
else
@echo "Unsupported architecture $(shell uname -m)! Update this Makefile!"
exit 1
endif
chmod +x shfmt
sudo mv shfmt /usr/local/bin/shfmt
@echo "Setting up shellcheck (Linux)..."
sudo apt-get install shellcheck || sudo yum install shellcheck || sudo dnf install shellcheck
else
@echo "Unsupported operating system! Update this Makefile or use macOS/Linux."
exit 1
endif
.PHONY: reqtxt
reqtxt:
poetry export -f requirements.txt --output requirements.txt
.PHONY: pcao
pcao:
pre-commit autoupdate
pre-commit autoupdate -c templates/base/.pre-commit-config.yaml