From be2b9d069f17b886200ff743e5d15a5a65510b03 Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" Date: Sat, 11 May 2024 01:15:46 +0530 Subject: [PATCH] refactor(cng): ugrade script + commitizen validation --- push.sh | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/push.sh b/push.sh index 773a77b..c3cb084 100755 --- a/push.sh +++ b/push.sh @@ -1,5 +1,35 @@ #!/bin/bash -git add . -git commit -m "⏳ @eshanized continuously updating the repository!" -git push origin master \ No newline at end of file +# Author : Eshanized +# Author URI : https://tonmoyinfrastructure.github.io/eshanized/ + +################################ NOTE ################################ +#!!!!!!!!!!!!! Exexcute all the scripts at your own risk !!!!!!!!!!!!! +# I have written the push script for Arch Linux and other Arch Based # +# Linux Distribution. So this script will only work in ArchLinux and # +# Arch based Linux Distribution. You may customize it according to # +# your Distribution. # +###################################################################### + +# ---> First We will check for commitizen is installed or not +check_commitizen() { + if ! pacman -Qq commitizen-go &> /dev/null; then + echo "Commitizen is not installed. Please install it using 'yay -S commitizen-go'." >&2 + exit 1 + fi +} + +# Function to stage, commit, and push changes +push_to_github() { + git add . + git cz + git push origin master +} + +# Main Function +main() { + check_commitizen + push_to_github +} + +main \ No newline at end of file