meilleur comptage du nombre de lignes dans les changements non commités
This commit is contained in:
parent
a280185a04
commit
c6c4d1b2c1
4
evomaintenance.sh
Normal file → Executable file
4
evomaintenance.sh
Normal file → Executable file
|
@ -104,7 +104,7 @@ if test -x "${GIT_BIN}"; then
|
||||||
export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}"
|
export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}"
|
||||||
# If the repository and the work tree exist, try to commit changes
|
# If the repository and the work tree exist, try to commit changes
|
||||||
if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then
|
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
|
if [ "${CHANGED_LINES}" != "0" ]; then
|
||||||
STATUS=$(${GIT_BIN} status --short | tail -n 10)
|
STATUS=$(${GIT_BIN} status --short | tail -n 10)
|
||||||
# append diff data, without empty lines
|
# 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}"
|
export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}"
|
||||||
# If the repository and the work tree exist, try to commit changes
|
# If the repository and the work tree exist, try to commit changes
|
||||||
if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then
|
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
|
if [ "${CHANGED_LINES}" != "0" ]; then
|
||||||
${GIT_BIN} add --all
|
${GIT_BIN} add --all
|
||||||
${GIT_BIN} commit --message "${TEXTE}" --author="${USER} <${USER}@evolix.net>" --quiet
|
${GIT_BIN} commit --message "${TEXTE}" --author="${USER} <${USER}@evolix.net>" --quiet
|
||||||
|
|
Loading…
Reference in a new issue