summaryrefslogtreecommitdiff
path: root/bin/sync-for-dionysus
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-04-09 10:37:29 -0700
committerSean Whitton <spwhitton@spwhitton.name>2016-04-09 10:37:29 -0700
commited64aacb460c8da1f5f0d136dd0361499e33fd30 (patch)
treeec297ada2e2b2153f796372e6d9597e5af026240 /bin/sync-for-dionysus
parentbefb71bc5743d65610823efe2fdd23592c98556c (diff)
downloaddotfiles-ed64aacb460c8da1f5f0d136dd0361499e33fd30.tar.gz
move syncing out of emacs and into myrepos
Diffstat (limited to 'bin/sync-for-dionysus')
-rwxr-xr-xbin/sync-for-dionysus39
1 files changed, 28 insertions, 11 deletions
diff --git a/bin/sync-for-dionysus b/bin/sync-for-dionysus
index c0095470..472d388d 100755
--- a/bin/sync-for-dionysus
+++ b/bin/sync-for-dionysus
@@ -1,6 +1,10 @@
#!/bin/sh
. "$HOME/.shenv"
+. "$HOME/lib/tputfs.sh"
+
+LOCAL="$HOME/lib/dionysus"
+FLASH="/media/swhitton/SPWHITTON/doc"
athena_cmd () {
# here we rely on the fact that ssh already passes argument
@@ -12,20 +16,33 @@ athena_cmd () {
}
if [ "$(hostname -f)" = "athena.silentflame.com" ]; then
- cd "$HOME/doc"
- mr sync
- cd "$HOME/lib/dionysus"
- git annex merge
+ cd "$HOME/doc" && mr sync
+ cd "$HOME/lib/dionysus" && git annex add && git annex sync
else
- # try to sync nickflash first
- cd /media/swhitton/SPWHITTON/doc 2>/dev/null && git annex add && git annex sync --content || true
- cd "$HOME/lib/dionysus" && git annex add && git annex sync --content athena
- # try to sync nickflash again
- cd /media/swhitton/SPWHITTON/doc 2>/dev/null && git annex sync --content && kill-ssh-and-umount /media/swhitton/SPWHITTON || true
+ if [ -d "$FLASH" ]; then
+ status adding new content on nickflash
+ cd $FLASH && git annex add
+ fi
+
+ status running main sync from ~/lib/dionysus
+ if [ -d "$FLASH" ]; then
+ cd "$HOME/lib/dionysus" && git annex add && git annex sync --content athena nickflash
+ else
+ cd "$HOME/lib/dionysus" && git annex add && git annex sync --content athena
+ fi
+
+ if [ -d "$FLASH" ]; then
+ status ensuring that new files on nickflash checked out
+ cd $FLASH && git annex sync
+ status attempting to unmount nickflash
+ kill-ssh-and-umount /media/swhitton/SPWHITTON || true
+ fi
+
+ status ensuring that new files on athena checked out
athena_cmd lib/dionysus "git annex merge"
+ status syncing ~/doc
athena_cmd doc "mr sync"
- cd "$HOME/doc"
- mr sync
+ cd "$HOME/doc" && mr sync
athena_cmd doc "mr sync"
fi