Skip to content
Permalink
Browse files

Extract generation of current date into function

  • Loading branch information...
lauft committed Mar 2, 2019
1 parent e6b4091 commit f05596fa1d439482cf2ca9dedc21bd42013868fe
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/timemachine
@@ -1,5 +1,10 @@
#!/bin/bash

function current_date()
{
date --rfc-3339=date
}

function random_minute()
{
echo "0$( rand -M 60 )" | sed "s|.\+\(..\)\$|\1|g"
@@ -44,7 +49,7 @@ until [[ -z "${1}" ]] ; do
shift
done

for day in ${days-$(date --rfc-3339=date)} ; do
for day in ${days-$( current_date )} ; do
for minute in ${minutes-$( random_minute )} ; do
for hour in ${hours-$( default_hours )} ; do
date="${day}T${hour}:${minute}"

0 comments on commit f05596f

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.