forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·22 lines (20 loc) · 1 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
set -e
if [[ "$1" != "semgrep" && ("$*" =~ "--config" || "$*" == "--help" || "$1" == "publish" || "$1" == "ci") ]]; then
# 1) --config is a required semgrep scan argument,
# so if it's present, we assume the user meant to call semgrep.
#
# -f is a valid --config alias,
# but that could also be part of many shell commands used by e.g. GitLab CI,
# and our docs always type out the full --config flag anyway,
# so we don't assume user meant to call semgrep in those cases.
#
# 2) if a known subcommand is used, we also assume the user meant to call semgrep.
>&2 echo "======= DEPRECATION WARNING ======="
>&2 echo "The returntocorp/semgrep Docker image's custom entrypoint will be removed by June 2022."
>&2 echo "Please update your command to explicitly call semgrep."
>&2 echo "Change from: docker run -v \$(pwd):/src returntocorp/semgrep $*"
>&2 echo "Change to: docker run -v \$(pwd):/src returntocorp/semgrep semgrep $*"
exec semgrep "$@"
fi
exec "$@"