From c639bfdd96891504230596cf2175af362bf90b4e Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 22 Aug 2023 11:08:05 -0400 Subject: [PATCH] Use correct project and directory in "already active shell" error message. --- internal/runners/shell/shell.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/runners/shell/shell.go b/internal/runners/shell/shell.go index 6a2e26c2d1..23617f3471 100644 --- a/internal/runners/shell/shell.go +++ b/internal/runners/shell/shell.go @@ -1,8 +1,11 @@ package shell import ( + "os" + "github.com/ActiveState/cli/internal/analytics" "github.com/ActiveState/cli/internal/config" + "github.com/ActiveState/cli/internal/constants" "github.com/ActiveState/cli/internal/errs" "github.com/ActiveState/cli/internal/locale" "github.com/ActiveState/cli/internal/logging" @@ -84,7 +87,9 @@ func (u *Shell) Run(params *Params) error { } if process.IsActivated(u.config) { - return locale.NewInputError("err_shell_already_active", "", proj.NamespaceString(), proj.Dir()) + activatedProjectNamespace := os.Getenv(constants.ActivatedStateNamespaceEnvVarName) + activatedProjectDir := os.Getenv(constants.ActivatedStateEnvVarName) + return locale.NewInputError("err_shell_already_active", "", activatedProjectNamespace, activatedProjectDir) } u.out.Notice(locale.Tl("shell_project_statement", "",