Skip to content

Instantly share code, notes, and snippets.

View Umut-Deniz1's full-sized avatar
🏠
Working from home

umut deniz Umut-Deniz1

🏠
Working from home
View GitHub Profile
#!/bin/bash
major() {
if IFS=. read -r major rest <version.txt || [ -n "$major" ]; then
echo "$((major + 1)).0.0.$1" >"version.txt"
else
echo "ERROR: Unable to read version number from version.txt" >&2
exit 1
fi
}
options:
docker: true
definitions:
services:
docker:
memory: 3072
pipelines:
custom:
@Umut-Deniz1
Umut-Deniz1 / commit-msg-checker.sh
Created November 23, 2022 13:04
Add your own custom commit message check into git hooks. The checker control commit messages whether correct according to conventional commit .
#!/usr/bin/env bash
if [ ! -x .git/hooks/commit-msg ] || [ ! -f .git/hooks/commit-msg ] || ! cmp ./hooks/commit-msg.sh .git/hooks/commit-msg
then
echo -e "\033[33m Setting Up Git commit Hook..."
mkdir -p .git/hooks/
cp ./hooks/commit-msg.sh .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
echo -e "\033[32m Done"
echo -e "\033[33m You can make commit now."