Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit a8015e1

Browse files
committed
feat: add windows support for running kui as a kubectl plugin
Fixes #4235
1 parent 14c27ba commit a8015e1

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export PATH=$PWD/Kui-darwin-x64:$PATH
2929
kubectl kui get pods
3030
```
3131

32-
After the final command, you should see a popup window listing pods in your current namespace.
33-
**Note**: Windows support for operating as a kubectl plugin coming soon.
32+
After the final command, you should see a popup window listing pods in
33+
your current namespace. **Note:** On Windows, Kui currently has
34+
kubectl plugin support for UNIX shells and PowerShell.
3435

3536
## Contributing
3637

packages/builder/dist/electron/build.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ function win32 {
171171
mv "$BUILDDIR/${PRODUCT_NAME}-win32-x64/" "$BUILDDIR/${CLIENT_NAME}-win32-x64/"
172172
fi
173173

174+
echo "Add kubectl-kui UNIX shell script to electron build win32"
175+
(cd "$BUILDDIR/${CLIENT_NAME}-linux-x64" && touch kubectl-kui && chmod +x kubectl-kui \
176+
&& echo '#!/usr/bin/env sh
177+
export KUI_POPUP_WINDOW_RESIZE=true
178+
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
179+
"$SCRIPTDIR"/Kui kubectl $@ &' >> kubectl-kui)
180+
181+
echo "Add kubectl-kui PowerShell script to electron build win32"
182+
(cd "$BUILDDIR/${CLIENT_NAME}-linux-x64" && touch kubectl-kui.ps1 && chmod +x kubectl-kui.ps1 \
183+
&& echo '$Env:KUI_POPUP_WINDOW_RESIZE="true"
184+
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
185+
Write-Host "Current script directory is $ScriptDir"
186+
Write-Host "yoyo $args"
187+
$argv = "kubectl " + $args
188+
Start-Process -NoNewWindow $ScriptDir/Kui.exe -ArgumentList $argv' >> kubectl-kui.ps1)
189+
174190
#
175191
# deal with win32 packaging
176192
#
@@ -206,7 +222,6 @@ function mac {
206222
fi
207223

208224
echo "Add kubectl-kui to electron build darwin"
209-
210225
(cd "$BUILDDIR/${CLIENT_NAME}-darwin-x64" && touch kubectl-kui && chmod +x kubectl-kui \
211226
&& echo '#!/usr/bin/env sh
212227
export KUI_POPUP_WINDOW_RESIZE=true
@@ -259,7 +274,6 @@ function linux {
259274
fi
260275

261276
echo "Add kubectl-kui to electron build linux"
262-
263277
(cd "$BUILDDIR/${CLIENT_NAME}-linux-x64" && touch kubectl-kui && chmod +x kubectl-kui \
264278
&& echo '#!/usr/bin/env sh
265279
export KUI_POPUP_WINDOW_RESIZE=true

0 commit comments

Comments
 (0)