Compare commits

..

No commits in common. '44ff1cfdc136f7b09ada221bce0bf3a956912ce8' and '2db7a877c8f2a23a155618e0e9ffc0dbab5c104e' have entirely different histories.

@ -344,13 +344,10 @@ if $maintrack; then
fi
# Run pdflatex, bibtex, and company
# Leaving this if-else for historical reasons, and also to print the message
if $ltxmkrc; then
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK, detected .latemxkrc file${NOFORMAT}"
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK with RC file${NOFORMAT}"
simpledelay.sh 2
# note: latexmk does not need us to invoke "-r .latexmkrc", it finds and uses
# the RC file automatically (as evidenced by latexmk's output)
latexmk -pdf -bibtex $jobname
latexmk -r .latexmkrc -pdf -bibtex $jobname
else
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK${NOFORMAT}"
simpledelay.sh 2
@ -449,20 +446,10 @@ cetcest=$(date +%Z)
endtime=$(date +%s)
runtime=$(( $endtime - $starttime ))
# send push message to Gotify server
# send push message via Gotify CLI
# if runtime is longer than X minutes (suitable limit perhaps 3 min)
if (( $runtime > 70 )); then
# POST request to Gotify server works without needing Gotify CLI on this box
# NOTE, multi-line bash command fails if interrupted by comment lines!
# Hide CURL response (-o /dev/null) and progress bar (--silent)
# https://gotify.net/docs/pushmsg
curl -X POST "https://gotify.chepec.se/message?token=A8nO3zYJ-R1wG__" \
-F "message=chertex.sh $@. Completed in $runtime s" \
-F "title=$dir_wd" -F "priority=5" \
-o /dev/null --silent
# https://stackoverflow.com/questions/3872427/how-to-send-line-break-with-curl
# I could not make multi-line message (to Gotify) work here, however I tried. Giving up for now.
msg "Push notification sent to Gotify"
if (( $runtime > 180 )); then
gotify push --quiet --title "$dir_wd" --priority 5 "chertex.sh $@ \nCompleted in $runtime s"
fi
msg "${On_Cyan}-------------------------------------${NOFORMAT}"

@ -1,59 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
msg() {
echo >&2 -e "${1-}"
}
die() {
local msg=$1
local code=${2-1} # default exit status 1
msg "$msg"
simpledelay.sh 2 # short delay to aid reading last message in case terminal closes on exit
exit "$code"
}
parse_params() {
while :; do
case "${1-}" in
-?*) die "Unknown option: $1" ;;
*) break ;;
esac
shift
done
args=("$@")
return 0
}
parse_params "$@"
this_submod=${args[0]}
this_subtmp="${args[0]}_tmp"
# https://stackoverflow.com/a/16162228
msg "moving $this_submod to $this_subtmp"
mv $this_submod $this_subtmp
msg "git submodule deinit"
git submodule deinit $this_submod
msg "git rm $this_submod"
git rm $this_submod
msg "moving back $this_submod"
mv $this_subtmp $this_submod
msg "remove the existing .git file"
rm $this_submod/.git
msg "move the .git folder from modules into $this_submod"
mv .git/modules/$this_submod $this_submod/.git
msg "remove the worktree line from .git/config"
sed -i '/worktree/d' $this_submod/.git/config
msg "add $this_submod to .gitignore"
echo "$this_submod" >> .gitignore
Loading…
Cancel
Save