123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #!/bin/bash
-
-
-
-
-
- die() {
- echo "$@" >&2
- exit 2
- }
-
- mkmsg() {
-
-
-
- local host=$(hostname)
- local date=$(date -Isec)
- echo "WIP slurp, $date at $host"
- }
-
- allowed_anything() {
-
-
-
- test -f "$ok_file"
- }
-
- allowed_push() {
-
-
-
- grep -qxF PUSH "$ok_file"
- }
-
- main() {
- local git_root
- local ok_file
- local want_push=false
-
- git_root="$(git rev-parse --show-toplevel)" || die
- ok_file="$git_root/.git-slurp-ok"
-
- allowed_anything || die "you don't want this."
- allowed_push && want_push=true
-
- git add .
- git commit -m "$(mkmsg)"
- $want_push && git push
- }
-
- main
|