aws-lambda-layer-creator
aws-lambda-layer-creator copied to clipboard
Bad substitution issue
Hello,
I encountered a Bad substitution error when trying to use the create-layer.sh script with the following command:
./create-layer.sh node20-fetch-S3-SDK nodejs20.x @aws-sdk/client-s3 node-fetch ./create-layer.sh: 7: Bad substitution
The issue here is that the code asks to run any POSIX compliant shell #!/bin/sh but then uses non-POSIX compliant syntax. On ubuntu the shell used will be dash which does not support some of this syntax.
If you change the first line to #/bin/bash it will work fine.