Skip to content

Instantly share code, notes, and snippets.

@twalker
Created January 23, 2015 01:07
Show Gist options
  • Save twalker/3dffed86258a9185b22b to your computer and use it in GitHub Desktop.
Save twalker/3dffed86258a9185b22b to your computer and use it in GitHub Desktop.
post-deploy-replace-urls.sh
#!/bin/sh
# tbe source directory
# i.e. dev -- //sta-vs-wfmedia1/media/tbe/
SRC_DIR="$HOME/projects/Wordfly/Website/tms/nodeapp/test/file-fixtures/tbe"
# tbe destination parent directory
# i.e. staging/prod -- NEED PATH
DEST_DIR="$HOME/tmp"
echo "Copying tbe directory into destination"
cp -fR $SRC_DIR $DEST_DIR
echo "Replacing URLs in html files"
for f in "$DEST_DIR/tbe/**/*.html"
do
sed -i -e 's/dev.media.wordfly.com/media.wordfly.com/g' $f
sed -i -e 's/dev2.tracking.wordfly.com/tracking.wordfly.com/g' $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment