1 | #!/bin/bash
|
2 | # This is an example script that can be used in conjunction with the
|
3 | # on_modification config option to commit every note change to a git
|
4 | # repository. You'll need to place it somewhere on your $PATH. This
|
5 | # script assumes that your state_dir is also a git repository.
|
6 | set -e
|
7 |
|
8 | COMMIT_MESSAGE="automated commit ($HOSTNAME)"
|
9 |
|
10 | STATE_DIR="$(note config get state_dir)"
|
11 | GIT_DIR="$STATE_DIR/.git"
|
12 | WORK_DIR="$STATE_DIR"
|
13 | GIT="git --git-dir=$GIT_DIR --work-tree=$WORK_DIR"
|
14 |
|
15 | $GIT add --all
|
16 | $GIT commit -m "$COMMIT_MESSAGE"
|