Gitlab was updated! v14.5.1

Verified Commit 8dfa644a authored by Simão Afonso @ Powertools Tech's avatar Simão Afonso @ Powertools Tech
Browse files

Tweak installation script

- Add TODO
- Add version
- Comment scary `rm -rf` usage

This is the first beta version, it's already useful.
parent f8215ca6
#!/bin/bash
set -e
VIRTUALTEX_VERSION=0.1
# TODO: This is the latest version
# See "https://texlive.info/tlnet-archive/" for archived versions
TexLive_Repo=${CTAN_REPO:-http://mirror.ctan.org/systems/texlive/tlnet}
......@@ -12,6 +14,7 @@ setup_tinytex() { # Install Location
tmp="$(mktemp -d)" # Temporary Location
pushd "$tmp"
# TexLive
# TODO: Cache the TexLive_URL download in `~/.cache/???`
wget -nc "$TexLive_URL"{,.sha512,.sha512.asc}
sha512sum -c "$TexLive_File.sha512" # Verify hash
gpg --verify "$TexLive_File.sha512.asc" || true # TODO: Verify GPG
......@@ -32,12 +35,13 @@ setup_tinytex() { # Install Location
echo "- TexLive: $il_texlive"
echo "=> Platform (Script): $platform"
# TODO: Gate this to a `-f` flag
# Do it!
if [ -d "$il_texlive" ]; then
# TODO: I *think* TeXlive supports overwiting...
echo "=> Re-Installing TexLive"
rm -rf "$il_texlive"
fi
# if [ -d "$il_texlive" ]; then
# # TODO: I *think* TeXlive supports overwiting...
# echo "=> Re-Installing TexLive"
# rm -rf "$il_texlive"
# fi
echo "=> Installing TexLive @ '$il_texlive'"
# Ripped off from TinyTex: https://github.com/yihui/tinytex/blob/master/tools/tinytex.profile
cat >"$tmp/tinytex.profile" <<-TINYTEX
......@@ -76,6 +80,8 @@ setup_tinytex() { # Install Location
# "$tlmgr" --repository "https://texlive.info/tlgpg/" install tlgpg
echo "=> Add symlinks to '$il_bin'"
"$tlmgr" path add
echo "=> Mark virtualtex installation"
echo "VERSION=$VIRTUALTEX_VERSION" >"$il_texlive/virtualtex"
# Remove detritus
popd
......@@ -83,5 +89,15 @@ setup_tinytex() { # Install Location
}
install_location="${1:-"$PWD"}"
test -d "$install_location"
setup_tinytex "$install_location"
if [ -e "$install_location" ]; then
if test -d "$install_location"; then
echo "Existing Location: $install_location" >&2
exit 1
else
echo "Invalid Location: $install_location" >&2
exit 2
fi
else
mkdir "$install_location"
setup_tinytex "$install_location"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment