#!/bin/bash

rm -rf ./dist
yarn install
tsc
cp -r ./node_modules ./dist
#cp .env ./dist
cd dist
# 7z to recursively zip everything in the current folder
7z a -r -tzip ../scan-lambda.zip ./*
cd ..
aws lambda update-function-code --function-name scan-handler-v1 --zip-file fileb://scan-lambda.zip --profile LambdaAdmin
