Snippets

Created by Sergio Araújo
#!/bin/sh
# Last Change: Nov 13 2022 17:53

modified=$(git diff --cached --name-only --diff-filter=ACMR)

[ -z $modified ] && exit 0

for f in $modified; do
    data=$(date -r $f "+%a, %d %b %Y - %T")
    sed -ri "1,7s/^(\S*\s*Last (Change|Modified):).*/\1 $data/gi" $f
    git add $f
done

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.