[cmd_*] Fixed typo with detection of git directory
[parser] Fixed bug with exit code detection
This commit is contained in:
parent
0c22fcdf49
commit
87d8f8e167
7 changed files with 24 additions and 17 deletions
29
src/parser
29
src/parser
|
@ -27,7 +27,6 @@ while true; do
|
|||
if [ -z "${1#*=}" ]; then
|
||||
help
|
||||
else
|
||||
log ECHO "--git-dir called. Git directory now defined as: ${1#*=}"
|
||||
GIT_DIR="${1#*=}"
|
||||
fi
|
||||
|
||||
|
@ -46,41 +45,49 @@ case "${1}" in
|
|||
exclude)
|
||||
shift
|
||||
cmd_exclude "${GIT_DIR}" ${@}
|
||||
[[ $? -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ $? -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
include)
|
||||
shift
|
||||
cmd_include$ "${GIT_DIR}" ${@}
|
||||
[[ $? -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ $? -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
deploy)
|
||||
shift
|
||||
cmd_deploy "${GIT_DIR}" ${@}
|
||||
[[ $? -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ $? -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
update)
|
||||
shift
|
||||
cmd_update "${GIT_DIR}" ${@}
|
||||
[[ $? -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ $? -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
du)
|
||||
shift
|
||||
cmd_du "${GIT_DIR}" "${@}"
|
||||
[[ $? -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ $? -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
fsck)
|
||||
shift
|
||||
cmd_fsck "${GIT_DIR}" "${@}"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Database file non-existent"
|
||||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue