From 50c55119123b81bcf2df3d5ee4821903f17d67b3 Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 10:26:20 -0700 Subject: [PATCH 1/6] [cmd_deploy] Attempt at deploy_cp bad error handling --- src/cmd_deploy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd_deploy b/src/cmd_deploy index a711d32..c2a65e4 100644 --- a/src/cmd_deploy +++ b/src/cmd_deploy @@ -62,8 +62,9 @@ cmd_deploy() { [[ $? -ne 0 ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] ${imageid} could not be downloaded from server"; cat ${STDERR}; local ERR=true; continue; } fi deploy_cp "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} > ${STDERR} 2>&1 + [[ $? -ne 0 ]] && local CP_ERR=true [[ "${GIT_GET}" == "true" ]] && git -C "${GIT_DIR}" annex drop ${imageid}.flac >/dev/null 2>&1 - [[ $? -ne 0 ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] Copy of ${imageid} completed with errors"; cat ${STDERR}; local ERR=true; continue; } + [[ "${CP_ERR}" == "true" ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] Copy of ${imageid} completed with errors"; cat ${STDERR}; local ERR=true; continue; } fi From a299939cb0646fb9555ddaac69dd2036432b7f4a Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 10:31:53 -0700 Subject: [PATCH 2/6] [parser] Fixed broken option handling --- src/parser | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser b/src/parser index 5d2f16a..7b36d17 100644 --- a/src/parser +++ b/src/parser @@ -7,7 +7,7 @@ GIT_DIR="./" #Recursive argument parser -while [[ -z "${1}" ]]; do +while true; do case ${1} in --help) shift @@ -27,6 +27,7 @@ while [[ -z "${1}" ]]; do shift GIT_DIR="${1}" shift + return ;; esac From 54013450b4309a81a74ff594ba7b8f5a78314e40 Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 12:19:19 -0700 Subject: [PATCH 3/6] [parser] Another attempt at dealing with options parsing --- src/parser | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser b/src/parser index 7b36d17..208b2fc 100644 --- a/src/parser +++ b/src/parser @@ -27,7 +27,10 @@ while true; do shift GIT_DIR="${1}" shift - return + ;; + + *) + return 2 ;; esac From 8a7cdff1497a36f3fa66ae9c3057f655b797ca70 Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 12:20:58 -0700 Subject: [PATCH 4/6] [parser] Changed return to break --- src/parser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser b/src/parser index 208b2fc..c9ec0ce 100644 --- a/src/parser +++ b/src/parser @@ -30,7 +30,7 @@ while true; do ;; *) - return 2 + break 2 ;; esac From fb4cedb3d7a851e1bc2fb9174d7a2458eb37e640 Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 12:31:01 -0700 Subject: [PATCH 5/6] [parser] Fixed over-break and a shift what was not needed --- src/parser | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/parser b/src/parser index c9ec0ce..3221398 100644 --- a/src/parser +++ b/src/parser @@ -26,11 +26,10 @@ while true; do --git-dir) shift GIT_DIR="${1}" - shift ;; *) - break 2 + break ;; esac From d69fe45c582eec97bc97cf4aa34797412589619b Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 4 May 2018 12:32:12 -0700 Subject: [PATCH 6/6] Updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 518d97d..9a15760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,3 +39,7 @@ * Added help menu for fsck, update and deploy commands * Fixed bug in nonexistent id test where non-standard rows would be tests on * Changed --git-dir option to not necessitate "=" sign when defining git directory + +### v0.2.5 +* Fixed bug with command parser not parsing options correctly +* Fixed bug where deploy would fail with errors that didn't exist