Fix access rights of result

This commit is contained in:
maride 2024-09-18 09:27:26 +02:00
parent f4b54637aa
commit 8d51a85454

12
run.sh
View File

@ -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"