From 8d51a85454a85f33429932355295ea8f4d8212a9 Mon Sep 17 00:00:00 2001 From: maride Date: Wed, 18 Sep 2024 09:27:26 +0200 Subject: [PATCH] Fix access rights of result --- run.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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"