From 77d29af7a6153db9ed0da9f05191648a1bdee7fd Mon Sep 17 00:00:00 2001 From: Sebastien Stormacq Date: Sun, 2 Nov 2025 22:11:25 +0100 Subject: [PATCH] more fixes fro shell checks --- Examples/_MyFirstFunction/create_function.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Examples/_MyFirstFunction/create_function.sh b/Examples/_MyFirstFunction/create_function.sh index 71fd4ad7..f42ac73c 100755 --- a/Examples/_MyFirstFunction/create_function.sh +++ b/Examples/_MyFirstFunction/create_function.sh @@ -1,8 +1,7 @@ #!/bin/sh # check if docker is installed -which docker > /dev/null -if [[ $? != 0 ]]; then +if ! which docker > /dev/null; then echo "Docker is not installed. Please install Docker and try again." exit 1 fi @@ -13,11 +12,12 @@ echo "This script creates and deploys a Lambda function on your AWS Account. 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. " -read -p "Are you ready to create your first Lambda function in Swift? [y/n] " continue -if [[ continue != ^[Yy]$ ]]; then - echo "OK, try again later when you feel ready" - exit 1 -fi +printf "Are you ready to create your first Lambda function in Swift? [y/n] " +read -r continue +case $continue in + [Yy]*) ;; + *) echo "OK, try again later when you feel ready"; exit 1 ;; +esac echo "⚡️ Create your Swift command line project" swift package init --type executable --name MyLambda