summaryrefslogtreecommitdiff
path: root/bin/insinuate-dotfiles
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-07-31 10:44:00 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-07-31 10:50:14 +0100
commitade79ac29d190b05775c773764172123f8c89a43 (patch)
tree5e052d730324bf278dad612da727314024adcbda /bin/insinuate-dotfiles
parent24610b4a7dc00a11b66462b7ec37363d03d75b89 (diff)
downloaddotfiles-ade79ac29d190b05775c773764172123f8c89a43.tar.gz
another new technique for insinuate-dotfiles
Diffstat (limited to 'bin/insinuate-dotfiles')
-rwxr-xr-xbin/insinuate-dotfiles15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/insinuate-dotfiles b/bin/insinuate-dotfiles
index cf3c5e29..fdcfcaf1 100755
--- a/bin/insinuate-dotfiles
+++ b/bin/insinuate-dotfiles
@@ -30,7 +30,7 @@ set -e
. $HOME/.shenv
# assume connection sharing is set up in ~/.ssh/config
-ssh -fCN "$1"
+ssh -fN "$1"
if ssh "$1" "test -d src/dotfiles"; then
echo >&2 "src/dotfiles exists"
@@ -39,14 +39,15 @@ fi
ssh "$1" "mkdir -p src/dotfiles"
temp="$(mktemp -d -p $HOME/tmp insinuate.XXX)"
-sshfs -C "$1:src/dotfiles" "$temp"
-git clone --no-hardlinks --local --depth 1 -o local "$HOME/src/dotfiles" "$temp"
-( cd "$temp" && git remote rm local)
-fusermount -u "$temp"
-rm -rf "$temp"
+git clone --no-hardlinks --depth 1 -o local -b master \
+ "file://$HOME/src/dotfiles" "$temp"
+( cd "$temp" && git remote rm local )
+tar -C"$temp/.." -zcf - "$(basename $temp)" \
+ | ssh "$1" 'tar --strip-components=1 -Csrc/dotfiles -zxf -'
+rm -rf "$temp1"
# copy my gpg key over there so I can use `mr up` to update dotfiles
-if ssh "$1" which gpg; then
+if ssh "$1" which gpg >/dev/null; then
gpg --export-options export-minimal --export spwhitton@spwhitton.name \
| ssh "$1" gpg --import
fi