|
3 | 3 | # Run the Behat tests only if a Behat config file is found. |
4 | 4 | if [ ! -f "behat.yml" ]; then |
5 | 5 | echo 'Did not detect "behat.yml" file, skipping Behat tests.' |
6 | | - exit 0; |
| 6 | + exit 0; |
7 | 7 | fi |
8 | 8 |
|
9 | 9 | if ! command -v jq &> /dev/null |
10 | 10 | then |
11 | | - echo 'The required "jq" command was not found, please install it to run the Behat tests.' |
12 | | - echo "See https://stedolan.github.io/jq/download/ for installation instructions." |
13 | | - exit 1; |
| 11 | + echo 'The required "jq" command was not found, please install it to run the Behat tests.' |
| 12 | + echo "See https://stedolan.github.io/jq/download/ for installation instructions." |
| 13 | + exit 1; |
14 | 14 | fi |
15 | 15 |
|
16 | 16 | if [[ "$@" == *"--help"* ]]; then |
17 | | - vendor/bin/behat "$@" |
18 | | - ret=$? |
19 | | - exit $ret |
| 17 | + vendor/bin/behat "$@" |
| 18 | + ret=$? |
| 19 | + exit $ret |
20 | 20 | fi |
21 | 21 |
|
22 | 22 | # POSIX compliant function to check if a string is numeric. |
23 | 23 | is_numeric() { |
24 | | - case $1 in |
25 | | - ''|*[!0-9]*) return 1;; # returns 1 if not numeric |
26 | | - *) return 0;; # returns 0 if numeric |
27 | | - esac |
| 24 | + case $1 in |
| 25 | + ''|*[!0-9]*) return 1;; # returns 1 if not numeric |
| 26 | + *) return 0;; # returns 0 if numeric |
| 27 | + esac |
28 | 28 | } |
29 | 29 |
|
30 | 30 | # If DB type is already set to SQLite, there's nothing to do. |
@@ -100,11 +100,11 @@ SOURCE="${BASH_SOURCE[0]}" |
100 | 100 |
|
101 | 101 | # Resolve $SOURCE until the file is no longer a symlink. |
102 | 102 | while [ -h "$SOURCE" ]; do |
103 | | - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
104 | | - SOURCE="$(readlink "$SOURCE")" |
105 | | - # If $SOURCE was a relative symlink, we need to resolve it relative to the |
106 | | - # path where the symlink file was located. |
107 | | - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" |
| 103 | + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
| 104 | + SOURCE="$(readlink "$SOURCE")" |
| 105 | + # If $SOURCE was a relative symlink, we need to resolve it relative to the |
| 106 | + # path where the symlink file was located. |
| 107 | + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" |
108 | 108 | done |
109 | 109 |
|
110 | 110 | # Fetch the root folder of the WP-CLI tests package. |
|
0 commit comments