-
-
Notifications
You must be signed in to change notification settings - Fork 435
Expand file tree
/
Copy pathci-filter-supported-extensions
More file actions
executable file
·46 lines (39 loc) · 1.07 KB
/
Copy pathci-filter-supported-extensions
File metadata and controls
executable file
·46 lines (39 loc) · 1.07 KB
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
44
45
46
#!/bin/sh
# Let's set a sane environment
set -o errexit
set -o nounset
set -o noglob
SCRIPTS_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
. "$SCRIPTS_DIR/common"
ROOT_DIR="$(dirname -- "$SCRIPTS_DIR")"
DATA_DIR="$ROOT_DIR/data"
EXTENSIONS_LIST="${1:-}"
if test -z "$EXTENSIONS_LIST"; then
echo 'Extensions list not specified' >&2
exit 1
fi
ALL_SUPPORTED_EXTENSIONS="$(cat "$DATA_DIR/supported-extensions")"
SUPPORTED_EXTENSIONS=''
resetIFS
for EXTENSION in $EXTENSIONS_LIST; do
printf 'Checking extension "%s"... ' "$EXTENSION" >&2
NORMALIZED_EXTENSION="$EXTENSION"
case "$EXTENSION" in
datadog_trace)
NORMALIZED_EXTENSION=ddtrace
;;
pecl_http)
NORMALIZED_EXTENSION=http
;;
esac
if test "$NORMALIZED_EXTENSION" != "$EXTENSION"; then
printf '(using %s) ' "$NORMALIZED_EXTENSION" >&2
fi
if printf '%s' "$ALL_SUPPORTED_EXTENSIONS" | grep -q "^$NORMALIZED_EXTENSION\s"; then
printf 'supported.\n' >&2
SUPPORTED_EXTENSIONS="$SUPPORTED_EXTENSIONS $NORMALIZED_EXTENSION"
else
printf 'NOT supported.\n' >&2
fi
done
printf '%s' "${SUPPORTED_EXTENSIONS# }"