Created
March 13, 2014 22:18
-
-
Save inky/9538260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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