Skip to content

Instantly share code, notes, and snippets.

@isitgeorge
Created April 15, 2020 22:02
Show Gist options
  • Select an option

  • Save isitgeorge/ca3186f9f5d886e8b9413e1d48312539 to your computer and use it in GitHub Desktop.

Select an option

Save isitgeorge/ca3186f9f5d886e8b9413e1d48312539 to your computer and use it in GitHub Desktop.
#!/bin/bash
PORT=3000
DIRECTORYPORTPAIRS=""
for i in *
do
if [[ $i =~ "service-" ]]; then
DIRECTORYPORTPAIRS="${DIRECTORYPORTPAIRS} --directory $i --port $PORT"
((++PORT))
fi
done || exit 1
printf "\n%s\n" "Using command: ${DIRECTORYPORTPAIRS}"
serverless-offline-multi $DIRECTORYPORTPAIRS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment