dirty="$(git status --porcelain || true)"
diff="$(git diff --quiet && git diff --cached --quiet || true)"
-lsfiles="$([ -z git ls-files --others --exclude-standard ] || true)"
+lsfiles="$(git ls-files --others --exclude-standard || true)"
-if [[ -n "$diff" && -n "$lsfiles" ]]; then
+if [[ -n "$diff" && -z "$lsfiles" ]]; then
echo "[check] repo diff, go to proclean check."
if [[ -n "$dirty" ]]; then
echo "[check] repo dirty, stop"
fi
else
echo "[check] not clean. Go to autocommit him."
- if [[ -n "$lsfiles" ]]; then
+ if [[ -z "$lsfiles" ]]; then
git add .
git commit -m "${COMM_INFO}"
else