diff --git a/run.sh b/run.sh index b15531a..51a50c0 100755 --- a/run.sh +++ b/run.sh @@ -9,7 +9,7 @@ if test "$(ls -A /tex)"; then # Directory not empty - user mounted directory \o/ if [ -z "$TARGET" ]; then # target unset. - TARGET="*.tex" + TARGET="$(find /tex -iname '*.tex' | head --lines 1)" fi # Build in build dir @@ -20,7 +20,7 @@ if test "$(ls -A /tex)"; then echo "$ECHOPREFIX Targetting $TARGET" # Build the PDF - texi2pdf ../$TARGET + texi2pdf $TARGET cd .. @@ -45,9 +45,13 @@ if test "$(ls -A /tex)"; then ln -sf $BUILD ./current-build # Apply the access rights to build folder as found on the target file - chmod --reference=$TARGET -R $BUILD ./current-build ./last-successful ./last-failed + chmod --silent --reference=$TARGET -R $BUILD ./current-build + chmod --silent --reference=$TARGET -R $BUILD ./last-successful + chmod --silent --reference=$TARGET -R $BUILD ./last-failed chmod +x $BUILD - chown --reference=$TARGET -R $BUILD ./current-build ./last-successful ./last-failed + chown --silent --reference=$TARGET -R $BUILD ./current-build + chown --silent --reference=$TARGET -R $BUILD ./last-successful + chown --silent --reference=$TARGET -R $BUILD ./last-failed else # Directory is empty echo "$ECHOPREFIX Please mount your directory to /tex"