diff --git a/evomaintenance.sh b/evomaintenance.sh old mode 100644 new mode 100755 index c35565e..9ac6248 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -104,7 +104,7 @@ if test -x "${GIT_BIN}"; then export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}" # If the repository and the work tree exist, try to commit changes if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then - CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l) + CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l | tr -d ' ') if [ "${CHANGED_LINES}" != "0" ]; then STATUS=$(${GIT_BIN} status --short | tail -n 10) # append diff data, without empty lines @@ -161,7 +161,7 @@ if test -x "${GIT_BIN}"; then export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}" # If the repository and the work tree exist, try to commit changes if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then - CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l) + CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l | tr -d ' ') if [ "${CHANGED_LINES}" != "0" ]; then ${GIT_BIN} add --all ${GIT_BIN} commit --message "${TEXTE}" --author="${USER} <${USER}@evolix.net>" --quiet