diff options
Diffstat (limited to 'sync.sh')
| -rwxr-xr-x | sync.sh | 42 |
1 files changed, 31 insertions, 11 deletions
@@ -2,20 +2,40 @@ #Variables # ------------------------- +REPO="$HOME/Sandbox/hinode-template" +SRC="$REPO/public/" REMOTE="216.189.157.213" -SRC="/home/vassilios/Sandbox/SolarDump-Puffy/public/" -REPO="/home/vassilios/Sandbox/SolarDump-Puffy" -DST="/var/www/htdocs/solardump" +DST="/var/www/htdocs/corruptlamar" USERNAME="anoduck" +# ------------------------------------------ +compush() { + git add . + git commit -am $1 + setver autopatch +} -hugo +build() { + npm run build +} -cd "$SRC" || return - -rg --files-with-matches --fixed-strings '<meta name="robots" content="noindex">' | xargs -I % sed -i '/<meta name="robots" content="noindex">/d' % +# 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 +compush +build +cd "$SRC" || return +#alt_files +echo "Skipping cleaning of alt files" cd "$REPO" || return - -# $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" +sync |
