└── bash ├── extras ├── phpcs ├── phing.sh ├── phpcbf └── phpunit └── just-run-anything /bash/extras/phpcs: -------------------------------------------------------------------------------- 1 | PHPCS_PATH=vendor/bin:bin 2 | 3 | function phpcs { 4 | just_run_whatever phpcs "${PHPCS_PATH}" "$@" 5 | } 6 | -------------------------------------------------------------------------------- /bash/extras/phing.sh: -------------------------------------------------------------------------------- 1 | PHING_PATH=vendor/bin:bin 2 | 3 | function phing { 4 | just_run_whatever phing "${PHING_PATH}" "$@" 5 | } 6 | -------------------------------------------------------------------------------- /bash/extras/phpcbf: -------------------------------------------------------------------------------- 1 | PHPCBF_PATH=vendor/bin:bin 2 | 3 | function phpcbf { 4 | just_run_whatever phpcbf "${PHPCBF_PATH}" "$@" 5 | } 6 | -------------------------------------------------------------------------------- /bash/extras/phpunit: -------------------------------------------------------------------------------- 1 | PHPUNIT_PATH=vendor/bin:bin 2 | 3 | function phpunit { 4 | just_run_whatever phpunit "${PHPUNIT_PATH}" "$@" 5 | } 6 | -------------------------------------------------------------------------------- /bash/just-run-anything: -------------------------------------------------------------------------------- 1 | 2 | function just_run_whatever { 3 | WHATEVER="$1" 4 | TEST_PATHS=($2) 5 | 6 | IFS=":" 7 | for TEST_PATH in "${TEST_PATHS[@]}" 8 | do 9 | TEST_FILE="${TEST_PATH}/${WHATEVER}" 10 | if [ -x "${TEST_FILE}" ] 11 | then 12 | "${TEST_FILE}" "${@:3}" 13 | return $? 14 | fi 15 | done 16 | 17 | WHATEVER_ON_PATH="$(type -P "${WHATEVER}")" 18 | if [ -n "${WHATEVER_ON_PATH}" ] 19 | then 20 | "${WHATEVER_ON_PATH}" "${@:3}" 21 | return $? 22 | fi 23 | 24 | echo "${WHATEVER} not found in any location we expect" 25 | return 127 26 | } 27 | --------------------------------------------------------------------------------