-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deploy_frontend.sh grep command fails on mac #5940
Comments
Transfer the issue to sam cli. |
If you install |
You should add a PR for this and reference this issue :D |
Actually I'll make a PR. shouldn't be too tricky. |
@mrichman The jq command is not out of the box with Mac. Just tried it. I think we should have an out of the box solution. |
Fixes: aws/aws-sam-cli#5940 Script was failing for MacOS's default grep command
Fixes: aws/aws-sam-cli#5940 Script was failing for MacOS's default grep command
Fixes: aws/aws-sam-cli#5940 Script was failing for MacOS's default grep command
Proposed fix: aws/aws-sam-cli-app-templates#458 |
Fixes: aws/aws-sam-cli#5940 Script was failing for MacOS's default grep command Co-authored-by: Mohamed Elasmar <[email protected]>
|
Fixes: aws/aws-sam-cli#5940 Script was failing for MacOS's default grep command Co-authored-by: Mohamed Elasmar <[email protected]>
Description
sam init
command creates a 'deploy_frontend.sh' script which will fail for MacOS's default grep command. This is a commonly used OS and grep version for developers. The mac grep command does not support the -P flag, but the generated script callson line 41
that grep -oP part fails because the P option is not recognized.
I am sure there is another regex tool that we can use to extract that id string out of the invalidation_output (I have not come up with a solution myself yet).
The script will end up not waiting for the cloudfront invalidation-completed signal and will just end early. Not super breaking, but not ideal.
The solution I put in myself is not elegant and simply allows the error to happen and then calls ggrep instead which can be installed by homebrew on mac and has the -P option.
Steps to reproduce
On MacOS
Run
Select Option 1, then 13, then N, then N, then enter a name
Then
See output
Observed result
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --id: expected one argument
The invalidation is now complete - please visit your cloudfront URL to test
Expected result
Expected no errors
Additional environment details
sam --version
: SAM CLI, version 1.97.0The text was updated successfully, but these errors were encountered: