Skip to content

Commit

Permalink
Replace failing grep with builtin query
Browse files Browse the repository at this point in the history
Fixes: aws/aws-sam-cli#5940
Script was failing for MacOS's default grep command
  • Loading branch information
cibinmathew committed Oct 21, 2023
1 parent fa5ce2c commit 24def9a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ npm run build && cd dist/
aws s3 sync . s3://$s3_bucket_name/

# Create cloudfront invalidation and capture id for next step
invalidation_output=$(aws cloudfront create-invalidation --distribution-id $cloudfront_distribution_id --paths "/*")
invalidation_id=$(echo "$invalidation_output" | grep -oP '(?<="Id": ")[^"]+')
invalidation_id=$(aws cloudfront create-invalidation --distribution-id $cloudfront_distribution_id --paths "/*" --query "Invalidation.Id" --output text)

# Wait for cloudfront invalidation to complete
aws cloudfront wait invalidation-completed --distribution-id $cloudfront_distribution_id --id $invalidation_id
Expand Down

0 comments on commit 24def9a

Please sign in to comment.