summaryrefslogtreecommitdiff
path: root/archive/bin/sync-docs
blob: f03adb88a2f63b650a392ec32f314c311a807244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

. "$HOME/.shenv"
. "$HOME/lib/spw.sh"
. "$HOME/lib/tputfs.sh"

# Sync ~/doc, taking account of how I access it from Emacs, both
# locally and on athena

set -e

save-org-buffers
(
    cd $HOME/doc
    if win32; then
        cmd "/C doccheckin.bat" && git pull && git push
    elif [ "$(hostname -s)" = "athena" ]; then
        doccheckin && git pull && git push
    else
        status syncing on athena
        athena_cmd doc "mr sync"
        status syncing locally
        doccheckin && git pull && git push
        status syncing on athena again
        athena_cmd doc "mr sync"
    fi
)