summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMatt Fields2018-05-30 19:55:26 -0400
committerMatt Fields2018-05-30 19:55:26 -0400
commita72173bde847c62f78f02ffcc314b19160bd2804 (patch)
tree76feee6d8aa42d7bf8e1b35a75f3480cfee85dfd /PKGBUILD
parent9e8fdbe07d1753e42fe29d6247adcaa8daedcaff (diff)
downloadaur-a72173bde847c62f78f02ffcc314b19160bd2804.tar.gz
Use --no-scripts instead of faking, use system phpunit if available
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD19
1 files changed, 15 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a77c58f4b292..7be24a767088 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,8 +36,7 @@ prepare() {
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
- mkdir -p ".git/hooks"
- composer install --no-interaction --prefer-dist
+ composer install --no-interaction --prefer-dist --no-scripts
php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet
}
@@ -50,8 +49,20 @@ check() {
if [[ "${comp}" -eq "-1" ]]; then
./vendor/bin/phpunit
else
- echo "Installed PHP version incompatible with testing library... Skipping testing!";
+ echo "Notice: System PHP version incompatible with included phpunit!"
+ echo -n "Checking for system install of phpunit... ";
+ phpunit=1
+ hash phpunitas > /dev/null 2>&1 || phpunit=0
+ if [[ "${phpunit}" -eq "0" ]]; then
+ echo "Found!"
+ echo -n "Running test suite... "
+ phpunit > /dev/null
+ else
+ echo "Not Found... Skipping testing..."
+ fi
fi
+
+ echo -n "Binary reporting as "
php ./wp-cli.phar --version
}
@@ -59,6 +70,6 @@ package() {
cd "${srcdir}/${pkgname}-${pkgver}"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm655 wp-cli.phar "$pkgdir/usr/bin/wp"
- cd "$srcdir"
+ cd "${srcdir}"
install -Dm644 wp-completion.bash "${pkgdir}/usr/share/bash-completion/completions/wp"
}