Skip to content

Instantly share code, notes, and snippets.

@ljcooke
Last active January 3, 2022 03:44
Show Gist options
  • Save ljcooke/2420d5e0b5ab12bcf0f2e7ca320b1f66 to your computer and use it in GitHub Desktop.
Save ljcooke/2420d5e0b5ab12bcf0f2e7ca320b1f66 to your computer and use it in GitHub Desktop.
A script to revolutionise web3* using blockchain** (*update my website) (**bash)
#!/usr/bin/env bash
set -euo pipefail
deploy() {
rsync -Pachvz --exclude '.DS_Store' \
"${BUILD_DIR}/" "${REMOTE_HOST}:${REMOTE_PATH}/" "$@"
}
printf "\n== DRY RUN ==\n"
deploy --dry-run
printf "OK to deploy? [yN] "
read -r answer
if [ "$answer" = 'y' ]; then
deploy
else
exit 1
fi
BUILD_DIR=build
REMOTE_HOST=example.com
REMOTE_PATH=/var/www/example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment