mirror of
https://github.com/Snigdha-OS/snigdhaos-grub-theme.git
synced 2025-09-20 19:14:56 +02:00
refactor(commitizen): push with commitizen validation
This commit is contained in:
47
push.sh
47
push.sh
@@ -1,27 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Author : Eshan Roy <eshan@snigdhaos.org>
|
||||
# Author URI : https://eshanized.github.io/
|
||||
# Author : Eshan Roy
|
||||
# URI : https://eshanized.github.io
|
||||
|
||||
# NOTE: REPO = Your Repository Name On the Host
|
||||
# NOTE: ORG = Your ORGANIZATION NAME or USERNAME
|
||||
# NOTE: HOST = GitHub, Gitlab, Bitbucket etc.
|
||||
# NOTE: If you are on Snigdha OS,
|
||||
# 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.
|
||||
|
||||
# Repo Config
|
||||
REPO=snigdhaos-grub-theme
|
||||
# Host Config
|
||||
HOST=https://github.com
|
||||
# Destination Config
|
||||
ORG=Snigdha-OS
|
||||
# Function to check if Commitizen is installed
|
||||
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
|
||||
}
|
||||
|
||||
# Set the repository URL and branch
|
||||
REPO_URL="${HOST}/${ORG}/${REPO}.git"
|
||||
BRANCH="master" # or "main" depending on your repository's default branch
|
||||
|
||||
# Commit message
|
||||
MESSAGE="@eshanized: push via script"
|
||||
|
||||
# Add all files, commit, and push changes
|
||||
# Function to stage, commit, and push changes
|
||||
push_to_github() {
|
||||
git add .
|
||||
git commit -m "$MESSAGE"
|
||||
git push origin $BRANCH
|
||||
git cz
|
||||
git push origin master
|
||||
}
|
||||
|
||||
# Main Function
|
||||
main() {
|
||||
check_commitizen
|
||||
push_to_github
|
||||
}
|
||||
|
||||
main
|
Reference in New Issue
Block a user