-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-named.sh
More file actions
executable file
·43 lines (37 loc) · 933 Bytes
/
run-named.sh
File metadata and controls
executable file
·43 lines (37 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env -S bash --login
set -euo pipefail
# This wrapper script accepts named arguments and calls run.sh with positional arguments
# Get current location of script
basedir=$(dirname "$(readlink -f "$0")")
# Initialize variables
source=""
region=""
# Parse named arguments
while [[ $# -gt 0 ]]; do
case $1 in
--source)
source="$2"
shift 2
;;
--region)
region="$2"
shift 2
;;
*)
echo "Error: Unknown argument '$1'"
echo "Usage: $0 --source <value> [--region <value>]"
exit 1
;;
esac
done
# Validate all required arguments are provided
if [[ -z "$source" ]]; then
echo "Error: --source is required"
exit 1
fi
# Call run.sh with positional arguments
if [[ -n "$region" ]]; then
"${basedir}/run.sh" "$source" "$region"
else
"${basedir}/run.sh" "$source"
fi