summaryrefslogtreecommitdiffstats
path: root/sync-quartz.sh
diff options
context:
space:
mode:
authoranoduck <11767-anoduck@users.noreply.gitgud.io>2024-09-08 16:14:42 -0400
committeranoduck <11767-anoduck@users.noreply.gitgud.io>2024-09-08 16:14:42 -0400
commitd1c818c94c2667851fce3ff793d50a39f8b97552 (patch)
treecce7e68bc4fc99456e39d395d3ae5af46a8cb423 /sync-quartz.sh
parentd2a0fd14e05ef6b0b9fca454f8996faf86f94204 (diff)
feat: :construction: WIP: Builds...finally.
Added most of former content from quartz. Preliminary setup achieved.
Diffstat (limited to '')
-rwxr-xr-xsync-quartz.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/sync-quartz.sh b/sync-quartz.sh
new file mode 100755
index 0000000..8be7d15
--- /dev/null
+++ b/sync-quartz.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+#Variables
+# -------------------------
+REPO="/home/vassilios/Sandbox/quartz"
+SRC="$REPO/public/"
+REMOTE="216.189.157.213"
+DST="/var/www/htdocs/corruptlamar"
+USERNAME="anoduck"
+# ------------------------------------------
+build() {
+ npx quartz build
+}
+
+alt_files() {
+ rg --files-with-matches\
+ --fixed-strings\
+ '<meta name="robots" content="noindex">'\
+ | xargs -I % sed -i '/<meta name="robots" content="noindex">/d' %
+}
+
+sync() {
+ # $SRC_PATH must be _closed_ and ends _with_ a "/".
+ # $DST_PATH must be _open_ and ends _with_ _NO_ "/".
+ rsync -azv -e ssh --delete "$SRC" "$USERNAME"@"$REMOTE":"$DST"
+}
+# ------------------------------------------
+if [[ ! "$PWD" == "$REPO" ]]; then
+ cd "$REPO" || return
+fi
+build
+cd "$SRC" || return
+#alt_files
+echo "Skipping cleaning of alt files"
+cd "$REPO" || return
+sync