From c6c4d1b2c18c68a9e904fe93b5f697215f7111dd Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 25 Sep 2018 09:48:47 +0200 Subject: [PATCH] =?UTF-8?q?meilleur=20comptage=20du=20nombre=20de=20lignes?= =?UTF-8?q?=20dans=20les=20changements=20non=20commit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evomaintenance.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 evomaintenance.sh 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