wip
This commit is contained in:
parent
aeca1cf43f
commit
8d795ad707
1 changed files with 15 additions and 12 deletions
|
@ -530,21 +530,24 @@ __git__() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[[ -z "$commit_files" ]] && commit_files=.
|
if [ -n "$commit_files" ] || [ -n "$commit_message" ]; then
|
||||||
[[ -z "$commit_message" ]] && commit_message=wip
|
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
|
||||||
|
|
||||||
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
|
[[ -z "$commit_files" ]] && commit_files=.
|
||||||
|
[[ -z "$commit_message" ]] && commit_message=wip
|
||||||
|
|
||||||
|
if (("${#commit_files}" <= 1)); then
|
||||||
|
git add $commit_files
|
||||||
|
else
|
||||||
|
for f in "${commit_files[@]}"; do
|
||||||
|
git add $f
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
git commit -m "${commit_message:-wip}"
|
||||||
|
git push
|
||||||
|
|
||||||
if (("${#commit_files}" <= 1)); then
|
|
||||||
git add $commit_files
|
|
||||||
else
|
|
||||||
for f in "${commit_files[@]}"; do
|
|
||||||
git add $f
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git commit -m "${commit_message:-wip}"
|
|
||||||
git push
|
|
||||||
else
|
else
|
||||||
echo "${RED}${BOLD}There are changes on the remote branch. Please pull the latest changes first.${NC}"
|
echo "${RED}${BOLD}There are changes on the remote branch. Please pull the latest changes first.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue