Skip to content

Commit

Permalink
refactor: moving test script to main script.
Browse files Browse the repository at this point in the history
  • Loading branch information
eshanized committed May 2, 2024
1 parent 3d692ba commit 1e22d70
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
32 changes: 30 additions & 2 deletions push.sh
Original file line number Diff line number Diff line change
@@ -1,4 +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: 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.

# 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
}

# 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
10 changes: 9 additions & 1 deletion test-push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

# Author : Eshan Roy
# URI : https://eshanized.github.io

# 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.

# Function to check if Commitizen is installed
check_commitizen() {
if ! pacman -Qq commitizen-go &> /dev/null; then
Expand All @@ -15,7 +23,7 @@ push_to_github() {
git push origin master
}

# Main script
# Main Function
main() {
check_commitizen
push_to_github
Expand Down

0 comments on commit 1e22d70

Please sign in to comment.