Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install reqired tlmgr in install script if necessary #215

Merged
merged 12 commits into from Mar 20, 2024
86 changes: 30 additions & 56 deletions steps/install.sh
Expand Up @@ -47,41 +47,26 @@ if [ -n "${linux}" ]; then
apt-get install -y coreutils
fi

if ! parallel --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get -y install parallel
else
echo "Install 'parallel' somehow"
exit 1
fi
fi

if ! bc -v >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y bc
else
echo "Install 'GNU bc' somehow"
exit 1
fi
fi

if ! cloc --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y cloc
else
echo "Install 'cloc' somehow"
exit 1
fi
fi

if ! jq --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y jq
else
echo "Install 'jq' somehow"
exit 1
fi
fi
function install_package() {
local PACKAGE=$1

if ! eval "$PACKAGE" --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y "$PACKAGE"
else
echo "Install '$PACKAGE' somehow"
exit 1
fi
fi
}

install_package "parallel"
install_package "bc"
install_package "cloc"
install_package "jq"
install_package "shellcheck"
install_package "aspell"
install_package "xmlstarlet"

if ! pdftotext -v >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
Expand All @@ -92,29 +77,18 @@ if ! pdftotext -v >/dev/null 2>&1; then
fi
fi

if ! shellcheck --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y shellcheck
else
echo "Install 'shellcheck' somehow"
exit 1
fi
fi

if ! aspell --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y aspell
else
echo "Install 'GNU aspell' somehow"
exit 1
fi
fi

if ! xmlstarlet --version >/dev/null 2>&1; then
if [ ! -d /usr/local/texlive/"$(date +%Y)"/bin ]; then
if [ -n "${linux}" ]; then
apt-get install -y xmlstarlet
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
zcat < install-tl-unx.tar.gz | tar xf - && \
rm install-tl-unx.tar.gz && \
cd install-tl-"$(date +%Y)"* && \
perl ./install-tl --scheme=e --no-interaction
cd .. && rm -r install-tl-"$(date +%Y)"*
TEXLIVE_DIR=$(ls -d /usr/local/texlive/"$(date +%Y)"/bin/*/)
export PATH="$PATH:$TEXLIVE_DIR"
else
echo "Install 'xmlstarlet' somehow"
echo "Install 'texlive' somehow"
exit 1
fi
fi
Expand Down