Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit ac0a8eb

Browse files
authored
main: fix kubectl-dropin on windows (#48)
Allow for the case, on windows, that the zeroth command-line argument will have an `.exe` suffix when attempting to make the multi-call disambiguation. Signed-off-by: Jacob Blain Christen <[email protected]>
1 parent 99a10a9 commit ac0a8eb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ image-manifest-all:
9999
drone-local:
100100
DRONE_TAG=v0.0.0-dev.0+drone drone exec --trusted
101101

102-
.PHONE: dogfood
102+
.PHONY: dogfood
103103
dogfood: build
104104
DOCKER_IMAGE="./bin/kim image" make image
105+
106+
.PHONY: symlinks
107+
symlinks: build
108+
ln -nsf $(notdir $(BIN)) $(dir $(BIN))/kubectl-builder
109+
ln -nsf $(notdir $(BIN)) $(dir $(BIN))/kubectl-image

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55
import (
66
"os"
77
"path/filepath"
8+
"strings"
89

910
"github.com/containerd/containerd/pkg/seed"
1011
"github.com/rancher/kim/pkg/cli"
@@ -19,7 +20,7 @@ func init() {
1920
}
2021

2122
func main() {
22-
switch _, exe := filepath.Split(os.Args[0]); exe {
23+
switch exe := strings.Split(filepath.Base(os.Args[0]), `.exe`)[0]; exe {
2324
case "kubectl-builder":
2425
command.Main(cli.Builder(exe))
2526
case "kubectl-image":

0 commit comments

Comments
 (0)