Skip to content

Commit 77d29af

Browse files
committed
more fixes fro shell checks
1 parent 6502638 commit 77d29af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Examples/_MyFirstFunction/create_function.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/sh
22

33
# check if docker is installed
4-
which docker > /dev/null
5-
if [[ $? != 0 ]]; then
4+
if ! which docker > /dev/null; then
65
echo "Docker is not installed. Please install Docker and try again."
76
exit 1
87
fi
@@ -13,11 +12,12 @@ echo "This script creates and deploys a Lambda function on your AWS Account.
1312
You must have an AWS account and know an AWS access key, secret access key, and an optional session token. These values are read from '~/.aws/credentials' or asked interactively.
1413
"
1514

16-
read -p "Are you ready to create your first Lambda function in Swift? [y/n] " continue
17-
if [[ continue != ^[Yy]$ ]]; then
18-
echo "OK, try again later when you feel ready"
19-
exit 1
20-
fi
15+
printf "Are you ready to create your first Lambda function in Swift? [y/n] "
16+
read -r continue
17+
case $continue in
18+
[Yy]*) ;;
19+
*) echo "OK, try again later when you feel ready"; exit 1 ;;
20+
esac
2121

2222
echo "⚡️ Create your Swift command line project"
2323
swift package init --type executable --name MyLambda

0 commit comments

Comments
 (0)