summaryrefslogtreecommitdiffstats
path: root/repo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'repo.sh')
-rwxr-xr-xrepo.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/repo.sh b/repo.sh
index 0003ddb..1b11af2 100755
--- a/repo.sh
+++ b/repo.sh
@@ -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