Skip to content

Commit 8f2ea43

Browse files
committed
harden and verbosify script
1 parent 681a41f commit 8f2ea43

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

entrypoint.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/bin/bash
2-
set -ex
2+
set -eux
33

44
strict=''
5+
schema=${INPUT_SCHEMA:-$1}
6+
target=${INPUT_VALIDATION:-$2}
57

6-
if [ -n "${INPUT_STRICT}" ]
8+
if [ -n "${INPUT_STRICT:-''}" ]
79
then
810
strict='--strict'
911
fi
1012

11-
yamale --schema ${INPUT_SCHEMA:-$1} ${INPUT_VALIDATION:-$2} $strict
13+
if [ ! -e $target ]
14+
then
15+
>&2 echo "Target does not exist: $target"
16+
exit 1
17+
fi
18+
19+
yamale --schema=${schema} $target $strict

0 commit comments

Comments
 (0)