#!/bin/bash -eu dir="$1" # get basename of realpath name=$(basename $(realpath "$dir")) cd "$dir" zip="../$name.zip" rm -f "$zip" zip -r -X -q "$zip" * -x "ev/* --exclude" -x "__pycache__/*" -x "*.pyc" aws lambda update-function-code --function-name "$name" --zip-file fileb://"$zip" aws lambda wait function-active --function-name "$name"