Skip to content

Commit 8ccdb12

Browse files
dtaivppsmortex
andauthored
Update _scripts/_malformeddates.sh
Co-authored-by: Romain Tartière <[email protected]> Signed-off-by: David Tippett <[email protected]>
1 parent 3569e03 commit 8ccdb12

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

_scripts/_malformeddates.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/sh
2-
2+
online_and_timezone=$(grep -Er --files-match '^online: true$' | xargs grep --files-with-match '^tz:')
3+
if [ -n "${malformed_event_dates}" ]; then
4+
echo "Online events should not have a time-zone. Offending files:" >&2
5+
echo "${malformed_event_dates}" >&2
6+
exit 1
7+
fi
8+
malformed_timezones=$(grep -Er --files-match '^tz:[^/]*$')
9+
if [ -n "${malformed_timezones}" ]; then
10+
echo "Time-zones should be in the form 'Continent/City'. Offending files:" >&2
11+
echo "${malformed_timezones}" >&2
12+
exit 1
13+
fi
314
malformed_event_dates=$(grep -Er --files-without-match '^eventdate: [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [-+][0-9]{4}$' _events)
415
if [ -n "${malformed_event_dates}" ]; then
516
echo "Malformed event date in:" >&2

0 commit comments

Comments
 (0)