Skip to content

Commit 1a0bfd1

Browse files
authored
Remove deprecation message for envs without project (#537)
1 parent 22cf91c commit 1a0bfd1

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

cmd/esc/cli/env.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,9 @@ func (cmd *envCommand) getNewEnvRef(
186186
cmd.envNameFlag, args = args[0], args[1:]
187187
}
188188

189-
ref, isRelative := cmd.getEnvRef(cmd.envNameFlag, nil)
189+
ref, _ := cmd.getEnvRef(cmd.envNameFlag, nil)
190190

191191
if !ref.hasAmbiguousPath {
192-
if !strings.Contains(cmd.envNameFlag, "/") && !isRelative {
193-
cmd.printDeprecatedNameMessage(cmd.envNameFlag, ref)
194-
}
195-
196192
return ref, args, nil
197193
}
198194

@@ -226,7 +222,6 @@ func (cmd *envCommand) getNewEnvRef(
226222
}
227223

228224
if !existsProject && existsLegacyPath {
229-
cmd.printDeprecatedNameMessage(cmd.envNameFlag, legacyRef)
230225
return legacyRef, args, nil
231226
}
232227

@@ -256,13 +251,9 @@ func (cmd *envCommand) getExistingEnvRefWithRelative(
256251
refString string,
257252
rel *environmentRef,
258253
) (environmentRef, error) {
259-
ref, isRelative := cmd.getEnvRef(refString, rel)
254+
ref, _ := cmd.getEnvRef(refString, rel)
260255

261256
if !ref.hasAmbiguousPath {
262-
if !strings.Contains(refString, "/") && !isRelative {
263-
cmd.printDeprecatedNameMessage(refString, ref)
264-
}
265-
266257
return ref, nil
267258
}
268259

@@ -295,7 +286,6 @@ func (cmd *envCommand) getExistingEnvRefWithRelative(
295286
}
296287

297288
if existsLegacyPath {
298-
cmd.printDeprecatedNameMessage(refString, legacyRef)
299289
return legacyRef, nil
300290
}
301291

@@ -399,10 +389,3 @@ func (cmd *envCommand) writePropertyEnvironmentDiagnostics(out io.Writer, diags
399389

400390
return nil
401391
}
402-
403-
func (cmd *envCommand) printDeprecatedNameMessage(name string, ref environmentRef) {
404-
msg := fmt.Sprintf(
405-
"%sWarning: Referring to an environment name ('%s') without a project is deprecated.\nPlease use '%s/%s' or '%s' instead.%s",
406-
colors.SpecWarning, name, ref.orgName, ref.Id(), ref.Id(), colors.Reset)
407-
fmt.Fprintln(cmd.esc.stderr, cmd.esc.colors.Colorize(msg))
408-
}

cmd/esc/cli/testdata/env-init-warning.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)