File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1- VERSION =v0.1.12
1+ VERSION =v0.1.13
22
33OUT_DIR =dist
44YEAR? =$(shell date +"% Y")
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ cf version
2323
2424``` bash
2525# download and extract the binary
26- curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.12 /cf-linux-amd64.tar.gz | tar zx
26+ curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.13 /cf-linux-amd64.tar.gz | tar zx
2727
2828# move the binary to your $PATH
2929mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636
3737``` bash
3838# download and extract the binary
39- curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.12 /cf-darwin-amd64.tar.gz | tar zx
39+ curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.13 /cf-darwin-amd64.tar.gz | tar zx
4040
4141# move the binary to your $PATH
4242mv ./cf-darwin-amd64 /usr/local/bin/cf
Original file line number Diff line number Diff line change @@ -155,7 +155,13 @@ func (c *Config) GetCurrentContext() *AuthContext {
155155 if c .contextOverride != "" {
156156 ctx = c .contextOverride
157157 }
158- return c .Contexts [ctx ]
158+
159+ authCtx , ok := c .Contexts [ctx ]
160+ if ! ok {
161+ log .G ().Fatalf (util .Doc ("Current Codefresh context \" %s\" does not exist. " +
162+ "You must select another context using '<BIN> config use-context <context>'" ), ctx )
163+ }
164+ return authCtx
159165}
160166
161167// NewClient creates a new codefresh client for the current context or for
@@ -172,7 +178,7 @@ func (c *Config) DeleteContext(name string) error {
172178
173179 delete (c .Contexts , name )
174180 if c .CurrentContext == name {
175- log .G ().Warnf (util .Doc ("delete context is set as current context, specify a new current context with '<BIN> config use-context'" ))
181+ log .G ().Warnf (util .Doc ("Deleted context is set as current context, specify a new current context with '<BIN> config use-context'" ))
176182 c .CurrentContext = ""
177183 }
178184
You can’t perform that action at this time.
0 commit comments