mirror of
https://github.com/Snigdha-OS/snigdhaos-system-installation.git
synced 2025-09-21 22:04:55 +02:00
refactor(users): add commitizen validation
This commit is contained in:
46
push.sh
46
push.sh
@@ -1,28 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# A simple script to maintain github repository
|
# Author : Eshan Roy
|
||||||
|
# URI : https://eshanized.github.io
|
||||||
|
|
||||||
# Author : Eshan Roy <eshan@snigdhaos.org>
|
# NOTE: If you are on Snigdha OS,
|
||||||
# Author URL : https://eshanized.github.io/
|
# you can install commitizen-go with `sudo pacman -S commitizen-go`
|
||||||
|
# or `s commitizen-go`. Else you need to install `yay` or `yay-bin`
|
||||||
|
# to install commitizen. I have written this script only for *Arch Linux.
|
||||||
|
|
||||||
# REPOSITORY Config
|
# Function to check if Commitizen is installed
|
||||||
REPO=snigdhaos-system-installation
|
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
|
||||||
|
}
|
||||||
|
|
||||||
# HOST Config
|
# Function to stage, commit, and push changes
|
||||||
HOST=https://github.com
|
push_to_github() {
|
||||||
|
git add .
|
||||||
|
git cz
|
||||||
|
git push origin master
|
||||||
|
}
|
||||||
|
|
||||||
# DESTINATION Config
|
# Main Function
|
||||||
ORG=Snigdha-OS
|
main() {
|
||||||
|
check_commitizen
|
||||||
|
push_to_github
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
# SETUP REPO URL
|
|
||||||
REPO_URL="${HOST}/${ORG}/${REPO}.git"
|
|
||||||
BRANCH="master" #or "main"
|
|
||||||
|
|
||||||
# Commit Message:
|
|
||||||
MESSAGE="@eshanized: push via push.sh!!!"
|
|
||||||
|
|
||||||
# Git Action
|
|
||||||
git add .
|
|
||||||
git commit -m "$MESSAGE"
|
|
||||||
git push origin "$BRANCH"
|
|
Reference in New Issue
Block a user