Changeset 36


Ignore:
Timestamp:
03/29/2006 01:35:16 (6 years ago)
Author:
ccowart
Message:

Setup error checking. -ccowart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r35 r36  
    334334# with no arguments, and will error if that's not the case. 
    335335function setup { 
    336         if [ -z $* ] ; then 
     336        local response 
     337        if [ ! -z $* ] ; then 
     338                print_usage 1 
     339        elif [ -d ${WORK_PATH} ] ; then 
     340                echo "Looks like ${WORK_PATH} already exists."  
     341                echo "Start over by removing it? (y/N)" 
     342                read response 
     343                if [[ $response =~ '^[yY](es|ES)?' ]] ; then 
     344                        rm -rf ${WORK_PATH} 
     345                        setup 
     346                else 
     347                        echo "Setup failed." >&2 
     348                        exit 1 
     349                fi 
     350        else 
    337351                conf_checkout_tree 
    338         else 
    339                 print_usage 1 
    340352        fi 
    341353} 
Note: See TracChangeset for help on using the changeset viewer.