-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·40 lines (35 loc) · 1.01 KB
/
entrypoint.sh
File metadata and controls
executable file
·40 lines (35 loc) · 1.01 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
#!/usr/bin/env bash
set -e
FAIL_ARG=""
if [[ "${INPUT_FAIL}" == "true" || "${INPUT_FAIL}" == "1" ]]
then {
FAIL_ARG="-f"
}
fi
REGEX_ARG=""
if [[ "${INPUT_REGEX}" != "" ]]
then {
REGEX_ARG="-r ${INPUT_REGEX}"
}
fi
# Generate the report
Rscript /main.R \
$FAIL_ARG \
-p "${INPUT_PATH:-.}" \
${REGEX_ARG} \
-s "${INPUT_RSPM_SNAPSHOT_DATE:-$(date "+%Y-%m-%d")}" \
-b "${INPUT_BIOC_RELEASE}" 2>&1 | tee output.raw
# Convert to HTML, if requested
TERMINAL_TO_HTML_VERSION="3.6.1"
if [[ "${INPUT_AS_HTML}" == "true" || "${INPUT_AS_HTML}" == "1" ]]
then {
echo "⏬ Downloading terminal-to-html"
wget -q \
-O t2html.gz \
"https://github.com/buildkite/terminal-to-html/releases/download/v${TERMINAL_TO_HTML_VERSION}/terminal-to-html-${TERMINAL_TO_HTML_VERSION}-linux-amd64.gz"
gunzip t2html.gz && chmod +x t2html
echo "📄 Saving output as HTML"
./t2html --preview < output.raw > license-report.html
echo "💾 HTML report saved at: $(pwd)/license-report.html"
}
fi