-
Notifications
You must be signed in to change notification settings - Fork 26
/
test.sh
executable file
·35 lines (31 loc) · 1.09 KB
/
test.sh
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
#!/bin/sh
set -euo pipefail
IFS=' ' read -r allowed <<< "native-promise-only zendesk_app_framework_sdk"
dependencies=$(npm ls --production --depth=0 --parseable | awk '{gsub(/\/.*\//,"",$1); print}')
for dep in $dependencies; do
if [[ ! ${allowed[*]} =~ (^|[[:space:]])"$dep"($|[[:space:]]) ]]; then
echo "::error ZAP SDK does not allow external dependencies, please remove \"${dep}\" dependency from package.json"
exit 1
fi
done
# for dep in $dependencies; do
# found=""
# for allow in $allowed[@]; do
# if [[ ${allow} == ${dep} ]]; then
# found=$allow
# continue
# fi
# done
# if [[ -z "$found" ]]; then
# echo "::error ZAP SDK does not allow external dependencies, please remove \"${dep}\" dependency from package.json"
# exit 1
# fi
# done
# for dep in $dependencies; do
# found=""
# for allow in $allowed[@]; do if [[ ${allow} == ${dep} ]]; then found=$allow continue fi done
# if [[ -z "$found" ]]; then
# echo "::error ZAP SDK does not allow external dependencies, please remove \"${dep}\" dependency from package.json"
# exit 1
# fi
# done