From 4a9cd066541cfeb1d146e31f8229c03e59349e6a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Nov 2025 14:07:34 -0700 Subject: [PATCH] Add code for commit function. --- tasks/general/acct_mgmt/users.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 296c181..4c75853 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1032,7 +1032,27 @@ alias flatpak-clean="flatpak uninstall --unused" alias_commit: | # 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 set_fact: