Update autocompile.sh

This commit is contained in:
Demircan 2026-09-18 10:16:03 +03:00
parent cbe22e6fde
commit d1c3006b7f

View file

@ -2,6 +2,7 @@
TEX_DOSYASI="${1:-test.tex}" TEX_DOSYASI="${1:-test.tex}"
PDF_DOSYASI="${TEX_DOSYASI%.tex}.pdf" PDF_DOSYASI="${TEX_DOSYASI%.tex}.pdf"
export DISPLAY=:0 export DISPLAY=:0
shopt -s nullglob # *.py/*.ipynb hiç yoksa git add'e "bulunamadı" hatası vermesin
# 1. OTOMATİK GÖNDERME (PUSH) FONKSİYONU # 1. OTOMATİK GÖNDERME (PUSH) FONKSİYONU
cleanup_and_push() { cleanup_and_push() {
@ -9,8 +10,9 @@ cleanup_and_push() {
# Eğer bir Git deposunun içindeysek (örneğin nonmarkov klasörü), otomatik push yap # Eğer bir Git deposunun içindeysek (örneğin nonmarkov klasörü), otomatik push yap
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo "☁️ Değişiklikler Forgejo'ya gönderiliyor..." echo "☁️ Değişiklikler Forgejo'ya gönderiliyor..."
# Hem kodu hem de PDF'i ekle ki arkadaşların site üzerinden PDF okuyabilsin # Kodu (tex/py/ipynb) ve PDF'i ekle ki arkadaşların site üzerinden okuyabilsin
git add *.tex "$PDF_DOSYASI" 2>/dev/null git add *.tex *.py *.ipynb 2>/dev/null
[ -f "$PDF_DOSYASI" ] && git add "$PDF_DOSYASI" 2>/dev/null
# O anki tarih ve saat ile otomatik commit mesajı oluştur # O anki tarih ve saat ile otomatik commit mesajı oluştur
git commit -m "Oto-Kayıt: $(date '+%Y-%m-%d %H:%M:%S')" git commit -m "Oto-Kayıt: $(date '+%Y-%m-%d %H:%M:%S')"
if timeout 10 git push origin main; then if timeout 10 git push origin main; then
@ -65,9 +67,25 @@ if [ ! -f "$TEX_DOSYASI" ]; then
cat << 'TEMPLATE' > "$TEX_DOSYASI" cat << 'TEMPLATE' > "$TEX_DOSYASI"
\documentclass{article} \documentclass{article}
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{amssymb}
\usepackage{physics} \usepackage{physics}
\usepackage{geometry}
\usepackage{hyperref}
\geometry{margin=0.1in}
\title{new paper side notes}
\author{Demircan Demirbağ}
\date{\today}
\begin{document} \begin{document}
author:Demircan
\maketitle
\tableofcontents
\newpage
\end{document} \end{document}
TEMPLATE TEMPLATE
fi fi