Skip to content

Commit cdc48dc

Browse files
committed
error when chmod without files
1 parent 78db447 commit cdc48dc

1 file changed

Lines changed: 33 additions & 8 deletions

File tree

‎bin/dbwebb-validate‎

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,37 @@ initBuildDir()
424424

425425

426426

427+
#
428+
# Publish all
429+
#
430+
publishChmod()
431+
{
432+
DIR="$1"
433+
434+
#find $BUILD/$dir/ -type d -print0 | xargs -0 chmod 755
435+
#find $BUILD/$dir/ -type f -print0 | xargs -0 chmod 644
436+
#find $BUILD/$dir/ -type f -name '*.cgi' -print0 | xargs -0 chmod 755
437+
#find $BUILD/$dir/ -type f -name '*.py' -print0 | xargs -0 chmod 600
438+
439+
for filename in $(find "$DIR" -type d); do
440+
chmod 755 "$filename"
441+
done
442+
443+
for filename in $(find "$DIR" -type f); do
444+
chmod 644 "$filename"
445+
done
446+
447+
for filename in $(find "$DIR" -type f -name '*.cgi'); do
448+
chmod 755 "$filename"
449+
done
450+
451+
for filename in $(find "$DIR" -type f -name '*.py'); do
452+
chmod 600 "$filename"
453+
done
454+
}
455+
456+
457+
427458
#
428459
# Publish all
429460
#
@@ -447,10 +478,7 @@ publish()
447478

448479
rsync -a --delete --exclude 'me/default' -f '- /*/' $TARGET/me/ $BUILD/me/
449480

450-
find $BUILD/me/ -type d -print0 | xargs -0 chmod 755
451-
find $BUILD/me/ -type f -print0 | xargs -0 chmod 644
452-
find $BUILD/me/ -type f -name '*.cgi' -print0 | xargs -0 chmod 755
453-
find $BUILD/me/ -type f -name '*.py' -print0 | xargs -0 chmod 600
481+
publishChmod "$BUILD/me/"
454482

455483
for filename in $(find $BUILD/me/ -maxdepth 1 -type f -name '*.html'); do
456484
assert 0 "$HTML_MINIFIER $HTML_MINIFIER_OPTIONS $filename --output $filename" "HTMLMinifier failed: $filename"
@@ -474,10 +502,7 @@ publish()
474502
$ECHO "\n $dir:"
475503
rsync -a --delete $TARGET/$dir/ $BUILD/$dir/
476504

477-
find $BUILD/$dir/ -type d -print0 | xargs -0 chmod 755
478-
find $BUILD/$dir/ -type f -print0 | xargs -0 chmod 644
479-
find $BUILD/$dir/ -type f -name '*.cgi' -print0 | xargs -0 chmod 755
480-
find $BUILD/$dir/ -type f -name '*.py' -print0 | xargs -0 chmod 600
505+
publishChmod "$BUILD/$dir/"
481506

482507
if [ -z "$SILENT" ]; then $ECHO " minify *.html"; fi
483508
#find "$BUILD/$dir/" -type f -name '*.html' | while read filename; do assert "0" "$HTML_MINIFIER $HTML_MINIFIER_OPTIONS $filename --output $filename" "HTMLMinifier failed: $filename"; done

0 commit comments

Comments
 (0)