Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile_Windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BINDIR = C:\tools

# Requires `make` with PowerShell as the shell. Easiest way:
# make -f Makefile_Windows SHELL=pwsh.exe install
# `cp` / `rm` resolve to PowerShell aliases, `New-Item` is PowerShell-native.

install: ## Install Target
go build -o ${BINDIR}/kxd/_kxd_prompt.exe
cp scripts/_kxd.ps1 ${BINDIR}/kxd/_kxd.ps1
cp scripts/_kxd_autocomplete.ps1 ${BINDIR}/kxd/_kxd_autocomplete.ps1
New-Item -ItemType File -Path ~/.kxd -Force

uninstall: ## Uninstall Target
rm -Force -Recurse ${BINDIR}/kxd
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ Untested by the maintainers. `~/.kube/config` symlinks created on the Windows si

`scripts/_kxd.ps1` and `scripts/_kxd_autocomplete.ps1` are PowerShell equivalents of the bash wrapper and autocomplete.

If you have `make` available on Windows, `Makefile_Windows` collapses steps 1–2 below into a single command:

```powershell
make -f Makefile_Windows SHELL=pwsh.exe install
```

That builds `_kxd_prompt.exe` and drops both `.ps1` files into `C:\tools\kxd\` (override with `BINDIR=...`). You still need to add that directory to `$env:PATH` and dot-source the scripts from your `$PROFILE` (step 3 below).

Otherwise, manual setup:

1. Build the Windows binary and put it somewhere on `$env:PATH`:
```powershell
$env:GOOS = "windows"; $env:GOARCH = "amd64"
Expand Down