Add code for commit function.
This commit is contained in:
@@ -1032,7 +1032,27 @@
|
|||||||
alias flatpak-clean="flatpak uninstall --unused"
|
alias flatpak-clean="flatpak uninstall --unused"
|
||||||
alias_commit: |
|
alias_commit: |
|
||||||
# TBD function to git add, git commit, and git push in a single go.
|
# TBD function to git add, git commit, and git push in a single go.
|
||||||
# Already exists on Termux env.
|
# Already exists on Termux env. Needs tested.
|
||||||
|
function commit_usage {
|
||||||
|
echo 'Usage: commit "This is a commit message"'
|
||||||
|
}
|
||||||
|
function commit {
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
echo "ERROR: Message must be provided."
|
||||||
|
commit_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ "$1" == "-h"* || "$1" == "--h"* ]]; then
|
||||||
|
commit_usage
|
||||||
|
fi
|
||||||
|
message="$1"
|
||||||
|
git add . &&
|
||||||
|
git commit -m "$message" &&
|
||||||
|
git push
|
||||||
|
|
||||||
|
status="$?"
|
||||||
|
return "$status"
|
||||||
|
}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
Reference in New Issue
Block a user