Skip to content

Instantly share code, notes, and snippets.

View umutdz's full-sized avatar
🏠
Working from home

umut deniz umutdz

🏠
Working from home
View GitHub Profile
@umutdz
umutdz / 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."
options:
docker: true
definitions:
services:
docker:
memory: 3072
pipelines:
custom:
@umutdz
umutdz / version.sh
Last active December 23, 2022 22:14
#!/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
}