Dropbox deploy script
Useful when working with static web pages.
Put this in the directory you're working in and running the script will copy the directory under ~/Dropbox/Public.
Accepts an optional argument that overrides the name of the directory when copied to Public/.
Some extras to uncomment at the bottom of the script.
#!/bin/bash
ARG=$1
set -x verbose #echo on
if [ -z "$ARG" ]; then
TARGET=$(basename $(pwd))
else
TARGET=$ARG
fi
rsync \
--delete-excluded \
--exclude $(basename $0) \
--exclude '.git*' \
--exclude 'node_modules/' \
-va . ~/Dropbox/Public/$TARGET
# Optional stuff
FILE_TO_LINK="index.html"
DROPBOX_ID=xxxxxx # Get a public link for something to get the ID
URL="https://dl.dropboxusercontent.com/u/$DROPBOX_ID/$TARGET/$FILE_TO_LINK"
# Copy public link to the clipboard
# echo -n $URL | pbcopy
# Open the directory in Finder
# open ~/Dropbox/Public/$TARGET
Written by Raine Virta
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Dropbox
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#