Files
AutoLTX/setupFiles/install.sh
2025-09-09 10:29:00 +05:30

34 lines
1007 B
Bash

#! /bin/bash
# Adapted from github.com/gkilleen33/overleaf-offline under the MIT license
# Add build files to gitignore
cd /app/project
if test -f ".autoltx"; then
echo AutoLTX already installed, skipping steup
else
if test -f ".gitignore"; then
# Adding build files to .gitignore
grep -qxF 'pdf/' .gitignore || echo 'pdf/' >> .gitignore
grep -qxF 'latexmkrc' .gitignore || echo 'latexmkrc' >> .gitignore
grep -qxF 'compile.sh' .gitignore || echo 'compile.sh' >> .gitignore
grep -qxF '.autoltx' .gitignore || echo '.autoltx' >> .gitignore
grep -qxF 'output.pdf' .gitignore || echo 'output.pdf' >> .gitignore
touch .autoltx
echo Configuring AutoLTX for this project
else
# Creating .gitignore file
printf 'pdf/\nlatexmkrc\ncompile.sh\n' >> .gitignore
fi
# mkdir -p pdf/config
# Add latexmk rc file to build files
cp /app/setupFiles/latexmkrc /app/project/
# Add compile script to build files
cp /app/setupFiles/compile.sh /app/project
chmod +x compile.sh
fi