From dba889814327b5e482eb21fdff832abc565c27b2 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Thu, 29 May 2014 16:05:10 -0700 Subject: [PATCH] script to update dates in demos --- build/update-demo-dates | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 build/update-demo-dates diff --git a/build/update-demo-dates b/build/update-demo-dates new file mode 100755 index 0000000..1ed31a4 --- /dev/null +++ b/build/update-demo-dates @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +read -p "Enter new year (4 digits): " year +read -p "Enter new month (2 digits): " month +read -p "This will modify files in the demos folder, is that ok? (y/n): " yn + +if [[ $yn != "y" ]] +then + exit +fi + +find "`dirname $0`/../demos" -type f \( -name '*.html' -o -name '*.json' \) -print0 \ +| xargs -0 sed -i '' -e "s/[0-9][0-9][0-9][0-9]-[0-9][0-9]/$year-$month/g" + +echo "DONE" \ No newline at end of file