print error message when projectId flag is not passed for set secret

This commit is contained in:
Maidul Islam
2024-07-18 18:05:01 -04:00
parent 5360fb033a
commit 4ba529f22d

View File

@@ -187,6 +187,10 @@ var secretsSetCmd = &cobra.Command{
var secretOperations []models.SecretSetOperation
if token != nil && (token.Type == util.SERVICE_TOKEN_IDENTIFIER || token.Type == util.UNIVERSAL_AUTH_TOKEN_IDENTIFIER) {
if projectId == "" {
util.PrintErrorMessageAndExit("When using service tokens or machine identities, you must set the --projectId flag")
}
secretOperations, err = util.SetRawSecrets(args, secretType, environmentName, secretsPath, projectId, token)
} else {
workspaceFile, err := util.GetWorkSpaceFromFile()