Skip to content

Commit 7e8fd5d

Browse files
committed
fix: don't use "kask" as a command context
Fixes #17
1 parent a555549 commit 7e8fd5d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go:
44

55
os:
66
- linux
7-
- osx
7+
# - osx
88
- windows
99

1010
install: true

kui/kui.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ type Context interface {
3333
// THE PLUGIN_VERSION CONSTANT SHOULD BE LEFT EXACTLY AS-IS SINCE IT CAN BE PROGRAMMATICALLY SUBSTITUTED
3434
const PLUGIN_VERSION = "dev"
3535

36+
// the command context to use for Kui command execution; this will be
37+
// the default, if we cannot infer one from e.g. the executable name
38+
// (whereby "kubectl-foo" implies a command context of "foo")
39+
const defaultCommandContext = "plugin"
40+
3641
type MainContext struct {
3742
_logger *log.SugaredLogger
3843
}
@@ -100,7 +105,10 @@ func (component *KuiComponent) Run(context Context, args []string) {
100105
if r.MatchString(base) {
101106
kuiCommandContext = r.ReplaceAllString(base, "")
102107
} else {
103-
kuiCommandContext = "plugin"
108+
kuiCommandContext = defaultCommandContext
109+
}
110+
if kuiCommandContext == "kask" {
111+
kuiCommandContext = defaultCommandContext
104112
}
105113
context.logger().Debugf("command context: %s", kuiCommandContext)
106114
cmd.Env = append(cmd.Env, "KUI_COMMAND_CONTEXT=" + kuiCommandContext)

0 commit comments

Comments
 (0)