Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ysawa0 committed May 12, 2024
1 parent 33dbbc1 commit f2c18d8
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@ setuppc:
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)..."
SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_amd64"
else ifeq ($(shell uname -m),aarch64)
@echo "Setting up shfmt for arm64 (Linux)..."
SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_arm64"
else
@echo "Unsupported architecture $(shell uname -m)! Update this Makefile!"
exit 1
endif
wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
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
ifeq ($(shell uname),x86_64)
@echo "Setting up shfmt (Linux)..."
SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_amd64"
wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
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 "Architecture not supported! Update this Makefile!"
exit 1
@echo "Unsupported operating system! Update this Makefile or use macOS/Linux."
exit 1
endif

.PHONY: reqtxt
Expand Down

0 comments on commit f2c18d8

Please sign in to comment.