diff options
-rwxr-xr-x | repo.sh | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -109,7 +109,11 @@ print_help() { echo } -if [ "$1" == '' ]; then +if [ "${SRC_PATH}" == '' ];then + echo 'ERROR: SRC_PATH variable not set.' +elif [ ! -d "${SRC_PATH}" ]; then + echo 'ERROR: SRC_PATH variable set to invalid path.' +elif [ "$1" == '' ]; then echo 'warning: no command called.' elif [ "$1" == 'add' ]; then if [ "$3" != '' ]; then @@ -144,6 +148,12 @@ elif [ "$1" == 'list' ]; then elif [ "$1" == 'update' ]; then if [ "$3" != '' ]; then echo 'error: too many arguments.' + elif [ "${REPO_PATH}" == '' ];then + echo 'ERROR: REPO_PATH variable not set.' + elif [ ! -d "${REPO_PATH}" ]; then + echo 'ERROR: REPO_PATH variable set to invalid path.' + elif [ "${REPO_NAME}" == '' ];then + echo 'ERROR: REPO_NAME variable not set.' elif [ "$2" != '' ]; then update_repo $2 else |