#!/bin/bash
set -o pipefail

echo "$TRAVIS_BRANCH"

if [ "$TRAVIS_BRANCH" = "master" ];
then
  echo "Deploying!" && \
  bower i && \
  npm run compile-all && \
  cp CNAME dist
  cd dist && \
  git init && \
  git add . && \
  git commit -m "deploy" && \
  git push --force --quiet "https://${GH_TOKEN}@github.com/marionettejs/marionettejs.com.git" master:gh-pages > /dev/null 2>&1
else
  npm run lint
fi

#!/bin/bash
set -o pipefail

echo "$TRAVIS_BRANCH"

if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" != "true" ]
then
  echo "Deploying!" && \
  bower i && \
  npm run compile-all && \
  cp CNAME dist
  cd dist && \
  git init && \
  git add . && \
  git commit -m "deploy" && \
  git push --force --quiet "https://${GH_TOKEN}@github.com/marionettejs/marionettejs.com.git" master:gh-pages > /dev/null 2>&1
else
  npm run lint
fi

Fix auto deployer to respect remote PRs
Fix auto deployer to respect remote PRs

based on the documentation around the travis_branch tending to be master
on remote PRs even when it is not on master.
