Closed philipws closed 1 year ago
It happened to me too. Is there any chance this can be avoided/fixed, please? Thanks in advance.
When running this from AWS CloudShell console it does work OK
@Yoimer I've created a PR for this #6 which will capture it for the Linux/OSX side. I don't know PowerShell to address the Windows side (if it exists there too).
Hoping @sebastiankasprzak , @psuresh78 , or @moelasmar can review and merge this.
@philipws Thanks for responding. You mean that if I apply this change you made(I have attached snapshot, this could work with no errors?
@Yoimer the PR has now been merged into the project. You can try again. Do note that I addressed it for Linux/OSX systems, not Windows, as I am not as familiar with PowerShell to determine if the same concern exists.
If there is a problem with the
${build_path}
var, or thepy_build.sh
is run directly in an attempt to test the build (therefore, no${build_path}
var), then this line will delete all user files.https://github.com/aws-samples/aws-sam-terraform-examples/blob/6e6c7a71bff059cb4e5b2a4a5d40f355e3e19401/zip_based_lambda_functions/api-lambda-dynamodb-example/py_build.sh#L18
Please add validation to ensure it has a value and forcing a base working path to start from.