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

Commit

Permalink
main: fix kubectl-dropin on windows (#48)
Browse files Browse the repository at this point in the history
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 <jacob@rancher.com>
  • Loading branch information
dweomer authored May 7, 2021
1 parent 99a10a9 commit ac0a8eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ image-manifest-all:
drone-local:
DRONE_TAG=v0.0.0-dev.0+drone drone exec --trusted

.PHONE: dogfood
.PHONY: dogfood
dogfood: build
DOCKER_IMAGE="./bin/kim image" make image

.PHONY: symlinks
symlinks: build
ln -nsf $(notdir $(BIN)) $(dir $(BIN))/kubectl-builder
ln -nsf $(notdir $(BIN)) $(dir $(BIN))/kubectl-image
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package main
import (
"os"
"path/filepath"
"strings"

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

func main() {
switch _, exe := filepath.Split(os.Args[0]); exe {
switch exe := strings.Split(filepath.Base(os.Args[0]), `.exe`)[0]; exe {
case "kubectl-builder":
command.Main(cli.Builder(exe))
case "kubectl-image":
Expand Down

0 comments on commit ac0a8eb

Please sign in to comment.