Created
May 7, 2026 14:01
-
-
Save maxfenton/216de8bc827fc141aaf9c04f6529cfa0 to your computer and use it in GitHub Desktop.
bin/backstop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Wrapper around the global `backstop` CLI. | |
| # | |
| # Usage: | |
| # bin/backstop reference # capture from production (default) | |
| # bin/backstop test --env=local # test against local DDEV site | |
| # bin/backstop reference --env=staging | |
| # bin/backstop approve | |
| # | |
| # --env=<local|staging|production> Sets BACKSTOP_ENV, read by backstop.cjs to pick baseUrl. | |
| # Defaults to production. | |
| ENV="production" | |
| ARGS=() | |
| for arg in "$@"; do | |
| case "$arg" in | |
| --env=*) ENV="${arg#*=}" ;; | |
| *) ARGS+=("$arg") ;; | |
| esac | |
| done | |
| BACKSTOP_ENV="$ENV" backstop "${ARGS[@]}" --config=backstop.cjs 2>&1 | grep -Ev 'BackstopTools have been installed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment