Skip to content

Commit 08f83f4

Browse files
committed
create project if doesn't exist
1 parent 0057334 commit 08f83f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cfn-resources/flex-cluster/test/cfn-test-create-inputs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -o pipefail
1010

1111
function usage {
1212
echo "usage:$0 <project_name>"
13-
echo "Generates test input files for flex cluster using an existing project"
13+
echo "Generates test input files for flex cluster"
1414
exit 0
1515
}
1616

@@ -30,8 +30,8 @@ fi
3030
projectName="${1}"
3131
projectId=$(atlas projects list --output json | jq --arg NAME "${projectName}" -r '.results[] | select(.name==$NAME) | .id')
3232
if [ -z "$projectId" ]; then
33-
echo "ERROR: Project \"${projectName}\" does not exist. Please create the project first."
34-
exit 1
33+
projectId=$(atlas projects create "${projectName}" --output=json | jq -r '.id')
34+
echo -e "Created project \"${projectName}\" with id: ${projectId}\n"
3535
else
3636
echo -e "FOUND project \"${projectName}\" with id: ${projectId}\n"
3737
fi

0 commit comments

Comments
 (0)