mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
b757de0241
* take advantage of @main where possible * move the top level Sample code to the examples subdirectory * extract a few examples form the "LambdaFunctions" directory (which is really a deployment demo) and move them to the top level Examples directory * rename "LambdaFunctions" examples as "Deployments" to make their intent clearer * add a sample that demonstrates how to test a lambda now that SwiftPM can test executables directly * update the test-sample docker setup to build & test th new samples * fix a few typos and In/Out typealias left overs * remove LinuxMain since its no longer required
39 lines
1.4 KiB
Bash
Executable File
39 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
##===----------------------------------------------------------------------===##
|
|
##
|
|
## This source file is part of the SwiftAWSLambdaRuntime open source project
|
|
##
|
|
## Copyright (c) 2017-2018 Apple Inc. and the SwiftAWSLambdaRuntime project authors
|
|
## Licensed under Apache License v2.0
|
|
##
|
|
## See LICENSE.txt for license information
|
|
## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
|
|
##
|
|
## SPDX-License-Identifier: Apache-2.0
|
|
##
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
executables=( $(swift package dump-package | sed -e 's|: null|: ""|g' | jq '.products[] | (select(.type.executable)) | .name' | sed -e 's|"||g') )
|
|
|
|
if [[ ${#executables[@]} = 0 ]]; then
|
|
echo "no executables found"
|
|
exit 1
|
|
elif [[ ${#executables[@]} = 1 ]]; then
|
|
executable=${executables[0]}
|
|
elif [[ ${#executables[@]} > 1 ]]; then
|
|
echo "multiple executables found:"
|
|
for executable in ${executables[@]}; do
|
|
echo " * $executable"
|
|
done
|
|
echo ""
|
|
read -p "select which executables to deploy: " executable
|
|
fi
|
|
|
|
echo "-------------------------------------------------------------------------"
|
|
echo "configuration"
|
|
echo "-------------------------------------------------------------------------"
|
|
echo "current dir: $DIR"
|
|
echo "executable: $executable"
|
|
echo "-------------------------------------------------------------------------"
|