#!/bin/bash

CFG_FILE=$HOME/.todo
[ -r "$CFG_FILE" ] || die "Fatal error:  Cannot read configuration file $CFG_FILE"
. "$CFG_FILE"

COUNT=1

while [ $COUNT -le 31 ]
do
LENGTH=`expr "$COUNT" : ".*"`
if [ "$LENGTH" = "1" ]; then
	NUMBER="0$COUNT"
else
	NUMBER=$COUNT
fi
mkdir -p $TICKLER_DIR/days/$NUMBER
touch $TICKLER_DIR/days/$NUMBER/$NUMBER.txt
COUNT=$[ $COUNT + 1 ]
done

COUNT=1

while [ $COUNT -le 12 ]
do
LENGTH=`expr "$COUNT" : ".*"`
if [ "$LENGTH" = "1" ]; then
	NUMBER="0$COUNT"
else
	NUMBER=$COUNT
fi
mkdir -p $TICKLER_DIR/months/$NUMBER
touch $TICKLER_DIR/months/$NUMBER/$NUMBER.txt
COUNT=$[ $COUNT + 1 ]
done

mkdir -p $TICKLER_DIR/today
