Skip to content

Commit e0c3d23

Browse files
committed
docs: add CodeCompanion help file and Makefile doc downloader
- add Makefile target to download codecompanion.txt for both Unix and Windows - include scripts/download_codecompanion.ps1 for Windows PowerShell support - add full codecompanion.txt Neovim help documentation to doc/ directory
1 parent 5f5c4be commit e0c3d23

File tree

3 files changed

+5509
-0
lines changed

3 files changed

+5509
-0
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: doc
2+
3+
OS := $(shell uname -s 2>/dev/null || echo Windows_NT)
4+
5+
# Default output path for the downloaded doc
6+
DOC_OUT := doc/codecompanion.txt
7+
8+
# Windows (PowerShell 7) target
9+
ifeq ($(OS),Windows_NT)
10+
# Prefer pwsh if available, fallback to powershell
11+
POWERSHELL := $(if $(shell where pwsh 2> NUL),pwsh,powershell)
12+
13+
doc:
14+
$(POWERSHELL) -NoProfile -ExecutionPolicy Bypass -File scripts/download_codecompanion.ps1 -OutFile $(DOC_OUT)
15+
16+
else
17+
# Non-Windows target uses curl or wget
18+
CURL := $(shell command -v curl 2>/dev/null)
19+
WGET := $(shell command -v wget 2>/dev/null)
20+
URL := https://github.com/olimorris/codecompanion.nvim/raw/refs/heads/main/doc/codecompanion.txt
21+
22+
doc:
23+
@mkdir -p doc
24+
ifeq ($(CURL),)
25+
ifeq ($(WGET),)
26+
@echo "Error: need curl or wget to download on non-Windows" && exit 1
27+
else
28+
@$(WGET) -O $(DOC_OUT) $(URL)
29+
endif
30+
else
31+
@$(CURL) -fsSL -o $(DOC_OUT) $(URL)
32+
endif
33+
endif

0 commit comments

Comments
 (0)