@@ -103,7 +103,7 @@ public function package( $args, $assoc_args ) {
103
103
104
104
$ force = Utils \get_flag_value ( $ assoc_args , 'force ' );
105
105
106
- $ package_root = dirname ( dirname ( __FILE__ ) );
106
+ $ package_root = dirname ( __DIR__ );
107
107
$ template_path = $ package_root . '/templates/ ' ;
108
108
$ wp_cli_yml = <<<EOT
109
109
require:
@@ -236,7 +236,7 @@ public function package_readme( $args, $assoc_args ) {
236
236
$ force = Utils \get_flag_value ( $ assoc_args , 'force ' );
237
237
$ branch = Utils \get_flag_value ( $ assoc_args , 'branch ' , 'master ' );
238
238
239
- $ package_root = dirname ( dirname ( __FILE__ ) );
239
+ $ package_root = dirname ( __DIR__ );
240
240
$ template_path = $ package_root . '/templates/ ' ;
241
241
242
242
$ bits = explode ( '/ ' , $ composer_obj ['name ' ] );
@@ -354,10 +354,10 @@ public function package_readme( $args, $assoc_args ) {
354
354
$ bundled = ! empty ( $ composer_obj ['extra ' ]['bundled ' ] );
355
355
foreach ( [ 'using ' , 'installing ' , 'contributing ' , 'support ' ] as $ key ) {
356
356
if ( isset ( $ readme_sections [ $ key ] ) ) {
357
- $ file = dirname ( dirname ( __FILE__ ) ) . '/templates/readme- ' . $ key . '.mustache ' ;
357
+ $ file = dirname ( __DIR__ ) . '/templates/readme- ' . $ key . '.mustache ' ;
358
358
if ( $ bundled
359
- && file_exists ( dirname ( dirname ( __FILE__ ) ) . '/templates/readme- ' . $ key . '-bundled.mustache ' ) ) {
360
- $ file = dirname ( dirname ( __FILE__ ) ) . '/templates/readme- ' . $ key . '-bundled.mustache ' ;
359
+ && file_exists ( dirname ( __DIR__ ) . '/templates/readme- ' . $ key . '-bundled.mustache ' ) ) {
360
+ $ file = dirname ( __DIR__ ) . '/templates/readme- ' . $ key . '-bundled.mustache ' ;
361
361
}
362
362
$ readme_sections [ $ key ]['body ' ] = $ file ;
363
363
}
@@ -459,7 +459,7 @@ public function package_github( $args, $assoc_args ) {
459
459
self ::check_if_valid_package_dir ( $ package_dir );
460
460
461
461
$ force = Utils \get_flag_value ( $ assoc_args , 'force ' );
462
- $ template_path = dirname ( dirname ( __FILE__ ) ) . '/templates ' ;
462
+ $ template_path = dirname ( __DIR__ ) . '/templates ' ;
463
463
464
464
$ composer_obj = json_decode ( file_get_contents ( $ package_dir . '/composer.json ' ), true );
465
465
$ settings_vars = [
@@ -650,7 +650,7 @@ public function package_tests( $args, $assoc_args ) {
650
650
Process::create ( Utils \esc_cmd ( 'mkdir %s ' , $ features_dir ) )->run ();
651
651
}
652
652
653
- $ package_root = dirname ( dirname ( __FILE__ ) );
653
+ $ package_root = dirname ( __DIR__ );
654
654
655
655
// Only create a sample feature file when none exist
656
656
if ( ! glob ( $ features_dir . '/*.feature ' ) ) {
@@ -798,5 +798,4 @@ private static function check_if_valid_package_dir( $package_dir ) {
798
798
WP_CLI ::error ( 'Invalid package directory. composer.json file must be present. ' );
799
799
}
800
800
}
801
-
802
801
}
0 commit comments