generated from reviewdog/action-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
install.sh
executable file
·37 lines (30 loc) · 921 Bytes
/
install.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
36
37
#!/bin/sh
set -eu
VERSION="${REVIEWDOG_VERSION:-latest}"
TEMP="${REVIEWDOG_TEMPDIR}"
if [ -z "${TEMP}" ]; then
if [ -n "${RUNNER_TEMP}" ]; then
TEMP="${RUNNER_TEMP}"
else
TEMP="$(mktemp -d)"
fi
fi
INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh'
if [ "${VERSION}" = 'nightly' ]; then
INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/nightly/master/install.sh'
VERSION='latest'
fi
mkdir -p "${TEMP}/reviewdog/bin"
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
(
if command -v curl 2>&1 >/dev/null; then
curl -sfL "${INSTALL_SCRIPT}"
elif command -v wget 2>&1 >/dev/null; then
wget -O - "${INSTALL_SCRIPT}"
else
echo "curl or wget is required" >&2
exit 1
fi
) | sh -s -- -b "${TEMP}/reviewdog/bin" "${VERSION}" 2>&1
echo '::endgroup::'
echo "${TEMP}/reviewdog/bin" >>"${GITHUB_PATH}"