-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·36 lines (27 loc) · 892 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·36 lines (27 loc) · 892 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
#!/usr/bin/env bash
# Set bash unofficial strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# Set DEBUG to true for enhanced debugging: run prefixed with "DEBUG=true"
${DEBUG:-false} && set -vx
# Credit to https://stackoverflow.com/a/17805088
# and http://wiki.bash-hackers.org/scripting/debuggingtips
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
ALLOW_PREFIXED=${INPUT_ALLOW_PREFIXED:-}
ALLOW_UPDATE=${INPUT_ALLOW_UPDATE:-}
EXCLUDE=${INPUT_EXCLUDE:-}
SHALLOW=${INPUT_SHALLOW:-}
FLAGS=""
if [[ -n "$ALLOW_PREFIXED" ]]; then
FLAGS="$FLAGS--allow-prefixed "
fi
if [[ -n "$ALLOW_UPDATE" ]]; then
FLAGS="$FLAGS--allow-update $ALLOW_UPDATE "
fi
if [[ -n "$EXCLUDE" ]]; then
FLAGS="$FLAGS--exclude $EXCLUDE "
fi
if [[ -n "$SHALLOW" ]]; then
FLAGS="$FLAGS--shallow"
fi
echo "versionator $FLAGS"