[parser] [cmd_fsck] Test specification now done by parser

This commit is contained in:
ayakael 2018-04-15 22:29:45 -04:00
parent 20cb57ecef
commit c8f81c2ecd
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
2 changed files with 40 additions and 18 deletions

View file

@ -88,7 +88,33 @@ case "${1}" in
fsck)
shift
cmd_fsck "${GIT_DIR}" "${@}"
while true; do
case ${1} in
--nonexistent-ids)
cmdList=(${cmdList[@]} nonexistent-ids)
shift
;;
--deployed-ids)
cmdList=(${cmdList[@]} deployed-ids)
shift
;;
--metadata)
cmdList=(${cmdList[@]} metadata)
shift
;;
*)
break 2
;;
esac
done
[[ -z ${cmdList[@]} ]] && cmdList=(deployed-ids nonexistent-ids metadata)
cmd_fsck "${GIT_DIR}" "${@}" ${cmdList[@]}
EXIT=$?
[[ ${EXIT} -eq 3 ]] && echo "Database file non-existent"
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"