summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-02-07 16:25:44 +0100
committerMartin Fischer <martin@push-f.com>2022-02-07 16:25:44 +0100
commit316ad6f346774cde1816cdf14f1cd96bdf44b759 (patch)
treeff5c445cc9ed9f190d20d800bc3fafd1d6392945
parentab5c537c65351b7cf5fba262c4850ac8d37e2814 (diff)
improve deploy.sh
-rwxr-xr-xdeploy.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/deploy.sh b/deploy.sh
index ad5b3f9..a7423c9 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,6 +1,10 @@
tar cf - -C dist . | ssh pydoc.dev 'sh -c "
set -x &&
cd /var/www/pydoc.dev &&
-rm -r * &&
-tar xvf -
+([ ! -d tmp ] || rm -r tmp) &&
+mkdir tmp &&
+tar xvf - -C tmp &&
+([ ! -d dist ] || mv dist old) &&
+mv tmp dist &&
+rm -r old
"'