misc: update error message being displayed

This commit is contained in:
Sheen Capadngan
2025-06-03 20:06:42 +08:00
parent c0add863be
commit f3fb65fcc3
5 changed files with 19 additions and 13 deletions
+5 -2
View File
@@ -253,7 +253,10 @@ func GetAllEnvironmentVariables(params models.GetAllSecretsParameters, projectCo
if params.InfisicalToken == "" && params.UniversalAuthAccessToken == "" {
if params.WorkspaceId == "" {
if projectConfigFilePath == "" {
RequireLocalWorkspaceFile()
_, err := GetWorkSpaceFromFile()
if err != nil {
PrintErrorMessageAndExit("Please either run infisical init to connect to a project or pass in project id with --projectId flag")
}
} else {
ValidateWorkspaceFile(projectConfigFilePath)
}
@@ -284,7 +287,7 @@ func GetAllEnvironmentVariables(params models.GetAllSecretsParameters, projectCo
if projectConfigFilePath == "" {
projectConfig, err := GetWorkSpaceFromFile()
if err != nil {
return nil, err
PrintErrorMessageAndExit("Please either run infisical init to connect to a project or pass in project id with --projectId flag")
}
infisicalDotJson = projectConfig