Add date fixer functions

This commit is contained in:
2026-01-30 11:12:50 +01:00
parent 47889c7d4c
commit 487e96b588
7 changed files with 305 additions and 12 deletions

View File

@@ -9,12 +9,10 @@ set -euo pipefail
# ./deploy.sh --dry-run # show what would change
# ./deploy.sh /path/to/luxtools
# ./deploy.sh --no-delete # don't delete extraneous files at target
# ./deploy.sh --preserve-times # keep source mtimes at target
TARGET="/thebe/Web/lib/plugins/luxtools"
DRY_RUN=0
DELETE=1
PRESERVE_TIMES=0
while (($#)); do
case "$1" in
@@ -26,10 +24,6 @@ while (($#)); do
DELETE=0
shift
;;
--preserve-times)
PRESERVE_TIMES=1
shift
;;
-h|--help)
sed -n '1,80p' "$0"
exit 0
@@ -85,12 +79,6 @@ RSYNC_ARGS=(
--exclude=.DS_Store
)
# DokuWiki's combined CSS (lib/exe/css.php) is cached and invalidated based on source file mtimes.
# When deploying to a mounted/remote filesystem with a different clock, preserving mtimes can make
# DokuWiki think the cache is always newer than your plugin CSS. Avoid that by default.
if (( ! PRESERVE_TIMES )); then
RSYNC_ARGS+=(--no-times --omit-dir-times)
fi
if ((DRY_RUN)); then
RSYNC_ARGS+=(--dry-run)
@@ -105,4 +93,20 @@ echo "Deploying luxtools to: $TARGET/"
rsync "${RSYNC_ARGS[@]}" "$SRC_DIR/" "$TARGET/"
# Invalidate DokuWiki cache by touching conf/local.php
# This forces DokuWiki to rebuild JavaScript/CSS bundles
CONF_LOCAL="$(dirname "$TARGET")/../../conf/local.php"
if [[ -f "$CONF_LOCAL" ]]; then
if ((DRY_RUN)); then
echo "(dry-run) Would touch $CONF_LOCAL to invalidate cache"
elif touch "$CONF_LOCAL" 2>/dev/null; then
echo "Cache invalidated (touched conf/local.php)"
else
echo "Note: Cannot touch conf/local.php (permission denied)."
echo " Run 'touch conf/local.php' on the server to clear cache."
fi
else
echo "Note: conf/local.php not found at expected path, skip cache invalidation."
fi
echo "Done."