16 lines
433 B
Bash
Executable File
16 lines
433 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# echo '[ -s "$(pwd)/pre-commit.sh" ] && "$(pwd)/pre-commit.sh"' >> .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
|
|
|
|
setdate() {
|
|
[[ ! "$1" =~ .*\.adoc$ ]] && return
|
|
# geändertes adoc
|
|
date=$(date -Iseconds)
|
|
sed -i "s/^:docdatetime:.*\$/:docdatetime: $date/" "$1"
|
|
git add "$1"
|
|
#echo "$1: $date"
|
|
}
|
|
|
|
git diff --cached --name-only | while read file; do setdate "$file"; done
|
|
#git add *.adoc
|