Refactoring in preparation for a recursive copy
Recursively copy directories

It works like this:

    if [ -d $g_source ]; then
      mkdir -p $g_target
      for child in $g_source/*; do
        copy_file "$g_source/$child" "$g_target/$child"
      done
    else
      cp $g_source $g_target
    fi

Only, you know, in 100 lines instead.