Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Don't stop on error
- set +e
- # Move to base directory
- pushd "$(git rev-parse --show-toplevel)" > /dev/null
- # Calculate path to config.yml file
- pathtoconfig=$(php -r 'define("CLI_SCRIPT", true);
- include "config.php";
- include("lib/behat/classes/behat_command.php");
- echo behat_command::get_behat_dir();')/behat.yml
- # Add quotes back to show the complete command
- forcequoted="[[:space:]]|[&,]"
- quoted=
- for i in "$@"
- do
- if [[ ${i} =~ ${forcequoted} ]]; then
- i=\'${i}\'
- fi
- quoted="${quoted} ${i}"
- done
- # no password is required because (sudo visudo) has, AFTER the admin entries!:
- # (or also in a /etc/sudoers.d/stronk7_as_www file, to make it persistent - else it's gone on every upgrade)
- # stronk7 ALL=(_www) NOPASSWD: ALL
- # (allow to run everything as _www without password to stronk7)
- # Run behat passing all params straight to it
- echo
- echo "Command: vendor/bin/behat --config ${pathtoconfig} ${quoted}"
- echo
- sudo -u _www vendor/bin/behat --config "${pathtoconfig}" "$@"
- status=$?
- # Move back to original directory
- popd > /dev/null
- exit $status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement