check for apt-get before installing jq

This commit is contained in:
Aaron Trudeau
2022-01-17 13:30:18 -05:00
parent da456a3fa0
commit 3f24118d3e
3 changed files with 22 additions and 8 deletions

21
dist/entrypoint.sh vendored
View File

@@ -7,6 +7,27 @@
ACTIVATE_LICENSE_PATH="$GITHUB_WORKSPACE/_activate-license"
mkdir -p "$ACTIVATE_LICENSE_PATH"
#
# Check if apt-get is available if in package mode (if not, we must abort since we need to install jq)
#
if [ "$PACKAGE_MODE" = "true" ]; then
echo "Running tests on a Unity package rather than a Unity project."
echo "Checking if apt-get is installed."
apt-get --version > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "apt-get is not installed. Aborting..."
exit
fi
# install jq
apt-get update \
&& apt-get upgrade -y --force-yes \
&& apt-get install -y --force-yes \
jq \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
fi
#
# Run steps
#