Skip to content

Instantly share code, notes, and snippets.

@inky
Created March 13, 2014 22:18
Show Gist options
  • Save inky/9538260 to your computer and use it in GitHub Desktop.
Save inky/9538260 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -o errexit # exit on error
set -o nounset # treat unset variables as an error
argc=$#
weeks=0
if [ $argc -ge 1 ]; then
if [ $1 -ge 1 ] && [ $1 -lt 100 ]; then
weeks=$1
fi
fi
if [ $weeks -le 0 ]; then
echo "usage: $0 number_of_weeks"
exit 1
fi
for week in $(seq -f 'week%02.f' 1 $weeks); do
mkdir -p $week
pushd $week
if [ ! -e .git ]; then
git init -q
git commit -q -m 'Initial commit' --allow-empty
fi
popd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment