#!/bin/bash

today=`date +%F' '%T`

printf -v sed_repl 's/Date: [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/Date: %q/g' "$today"

# update version date
find examples -type f -name '*.js' -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find lib -type f -name '*.js' -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find test -type f -name '*.js' -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find README* -type f -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find Makefile -type f -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find *.md -type f -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find *.json -type f -exec sed -r -i "$sed_repl" '{}' ';'
# update version date
find *.js -type f -name '*.js' -exec sed -r -i "$sed_repl" '{}' ';'