Skip to content

Instantly share code, notes, and snippets.

View tozwierz's full-sized avatar

Tomasz Zwierzchoń tozwierz

View GitHub Profile
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# forked by Tomasz Zwierzchon
root_dir="$(git rev-parse --show-toplevel)"
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"