-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (34 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
40 lines (34 loc) · 2.24 KB
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
# ── Install paths ─────────────────────────────────────────────────────────────
PREFIX ?= /usr/local/bin
# ── Phony targets ─────────────────────────────────────────────────────────────
.PHONY: install uninstall test lint clean
# ── Install ───────────────────────────────────────────────────────────────────
install: docx2md
@mkdir -p $(PREFIX)
@if [ -w $(PREFIX) ]; then \
cp docx2md $(PREFIX)/docx2md && chmod +x $(PREFIX)/docx2md; \
else \
sudo cp docx2md $(PREFIX)/docx2md && sudo chmod +x $(PREFIX)/docx2md; \
fi
@echo "✓ Installed to $(PREFIX)/docx2md"
# ── Uninstall ─────────────────────────────────────────────────────────────────
uninstall:
@if [ -w $(PREFIX)/docx2md ]; then \
rm $(PREFIX)/docx2md; \
else \
sudo rm $(PREFIX)/docx2md; \
fi
@echo "✓ Removed $(PREFIX)/docx2md"
# ── Test ──────────────────────────────────────────────────────────────────────
test:
@echo "Running shellcheck..."
@shellcheck docx2md install.sh || echo "⚠ shellcheck not installed, skipping"
@echo "Running conversion tests..."
@bash tests/run.sh
# ── Lint ──────────────────────────────────────────────────────────────────────
lint:
shellcheck docx2md install.sh
# ── Clean ─────────────────────────────────────────────────────────────────────
clean:
rm -f tests/fixtures/*.md
rm -rf tests/fixtures/images/