Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BackstopJS script to check out and test a branch against development
#!/bin/bash
git diff-index --quiet HEAD -- &>/dev/null
if [ $? -ne 0 ]; then
echo "Git status isn't clean! Please commit all changes first"
exit 1
fi
echo "Checking out development..."
git checkout development &>/dev/null
git pull origin development &>/dev/null
echo "Building latest development changes..."
npm run dev &>/dev/null
echo "Making Backstop reference files from development..."
echo "==================================================="
backstop reference &>/dev/null
echo "Checking out $1..."
git fetch &>/dev/null
git checkout $1 &>/dev/null
echo "Building $1..."
npm run dev &>/dev/null
echo "Testing $1..."
echo "==================================================="
backstop test &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.