Browse Source

Untangle main detection and file type detection

master
Joshua Nathaniel Pritikin 12 years ago
parent
commit
3295a5cf0a
  1. 13
      git-latexdiff

13
git-latexdiff

@ -290,12 +290,6 @@ if test -z "$main" ; then
main=$(git grep -l '^[ \t]*\\documentclass')
# May return multiple results, but if so the result won't be a file.
if test -r "$main" ; then
ext=${main##*\.}
case "$ext" in
Rnw) check_knitr ;;
Rtex) check_knitr ;;
*) ;;
esac
echo "Using $main as the main file."
else
if test -z "$main" ; then
@ -308,6 +302,13 @@ if test -z "$main" ; then
fi
fi
ext=${main##*\.}
case "$ext" in
Rnw) check_knitr ;;
Rtex) check_knitr ;;
*) ;;
esac
if test ! -r "$main" ; then
die "Cannot read $main."
fi

Loading…
Cancel
Save