Skip to content

Commit 8822837

Browse files
authored
Merge pull request #95 from wp-cli/fix/rectify-vendor-folder-discovery
Rectify vendor folder discovery
2 parents c97df89 + 06969cf commit 8822837

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,15 @@ private static function get_vendor_dir() {
181181
}
182182

183183
$paths = [
184+
dirname( dirname( __DIR__ ) ) . '/vendor/bin/wp',
184185
dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/bin/wp',
185186
dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) . '/bin/wp',
186-
dirname( dirname( __DIR__ ) ) . '/vendor/bin/wp',
187187
];
188188

189189
foreach ( $paths as $path ) {
190190
if ( file_exists( $path ) && is_executable( $path ) ) {
191-
$vendor_dir = (string) realpath( dirname( $path ) );
191+
$vendor_dir = (string) realpath( dirname( dirname( $path ) ) );
192+
192193
break;
193194
}
194195
}
@@ -632,10 +633,10 @@ public function build_phar( $version = 'same' ) {
632633

633634
// Test running against a package installed as a WP-CLI dependency
634635
// WP-CLI bundle installed as a project dependency
635-
$make_phar_path = self::get_vendor_dir() . '/../wp-cli/wp-cli-bundle/utils/make-phar.php';
636+
$make_phar_path = self::get_vendor_dir() . '/wp-cli/wp-cli-bundle/utils/make-phar.php';
636637
if ( ! file_exists( $make_phar_path ) ) {
637638
// Running against WP-CLI bundle proper
638-
$make_phar_path = self::get_vendor_dir() . '/../../utils/make-phar.php';
639+
$make_phar_path = self::get_vendor_dir() . '/../utils/make-phar.php';
639640
}
640641

641642
$this->proc(

0 commit comments

Comments
 (0)