#!/bin/bash
#
# Add a new problem to the workbook. This script simply creates the two
# necessary symlinks.
#
# Usage:
#
# ./add_problem NAME
#
# NOTE: NAME should NOT contain the .py extension or path, just the basename of
# the script. For example:
#
# ./add_problem qsort
#
# assumes there is a qsort.py problem in the examples directory, with
# qsort_skel.py in the skel/ subdir and a qsort_soln.py in the soln/ subdir.
prob=$1
startdir=$(pwd)
# do the skeleton
cd problems_skel
ln -s ../../examples/skel/${prob}_skel.py ${prob}.py
svn add ${prob}.py
# now do the solution
cd $startdir
cd problems_soln
ln -s ../../examples/soln/${prob}_soln.py ${prob}.py
svn add ${prob}.py