diff --git a/README.md b/README.md index 1c169a7..ac3f744 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,11 @@ new commit: 46fe26c9dcf2354a0ed3f304ed6818de9606f7b5 new commit: 21e5331d1c0256701bb90cf017e519d54a88f618 new commit: 47998b5317e66b3bd456cfb07268c93e223704f2 ... -done: 1342 commits +done: 4307 commits + +$ ls -ld all/* | wc -l +4307 + ``` diff --git a/scripts/backup.sh b/scripts/backup.sh index 461f95e..580704e 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -1,6 +1,8 @@ #!/bin/sh -set -e +set -o errexit +set -o nounset +set -o pipefail REPOSITORY=https://github.com/descartes-underwriting/devops-technical-test-data.git BRANCH=main @@ -116,9 +118,7 @@ do fi # Retrieve file state (Added, Modified, Deleted) - # Using basic regex as we want to avoid checking '()' or other complex regex patterns. - # This is suboptimal and error prone. But it passes the full backup :-) - STATE=$(${GIT} ${GIT_OPTS[@]} show --name-status --pretty= ${COMMIT_SHA} | grep -G "^..${FILE}\$" | cut -f1) + STATE=$(${GIT} ${GIT_OPTS[@]} show --name-status --pretty= ${COMMIT_SHA} -- "${FILE}" | cut -f1) if test "${STATE}" != "D" then