public function package_github( $args, $assoc_args ) {
		list( $package_dir ) = $args;

		if ( is_file( $package_dir ) ) {
			$package_dir = dirname( $package_dir );
		} else if ( is_dir( $package_dir ) ) {
			$package_dir = rtrim( $package_dir, '/' );
		}

		self::check_if_valid_package_dir( $package_dir );

		$force = Utils\get_flag_value( $assoc_args, 'force' );
		$template_path = dirname( dirname( __FILE__ ) ) . '/templates';

		$composer_obj = json_decode( file_get_contents( $package_dir . '/composer.json' ), true );
		$settings_vars = array(
			'has_description' => false,
			'description'     => '',
			'has_labels'      => true,
			'labels'          => array(
				array(
					'name'    => 'bug',
					'color'   => 'fc2929'
				),
				array(
					'name'    => 'scope:documentation',
					'color'   => '0e8a16'
				),
				array(
					'name'    => 'scope:testing',
					'color'   => '5319e7'
				),
				array(
					'name'    => 'good-first-issue',
					'color'   => 'eb6420',
				),
				array(
					'name'    => 'help-wanted',
					'color'   => '159818',
				),
				array(
					'name'    => 'maybelater',
					'color'   => 'c2e0c6',
				),
				array(
					'name'    => 'state:unconfirmed',
					'color'   => 'bfe5bf'
				),
				array(
					'name'    => 'state:unsupported',
					'color'   => 'bfe5bf'
				),
				array(
					'name'    => 'wontfix',
					'color'   => 'c2e0c6',
				),
			),
		);
		if ( ! empty( $composer_obj['description'] ) ) {
			$settings_vars['description'] = $composer_obj['description'];
			$settings_vars['has_description'] = true;
		}
		if ( ! empty( $composer_obj['extra']['commands'] ) ) {
			foreach ( $composer_obj['extra']['commands'] as $cmd ) {
				$settings_vars['labels'][] = array(
					'name'  => 'command:' . str_replace( ' ', '-', $cmd ),
					'color' => 'c5def5',
				);
			}
		}
		$create_files = array(
			"{$package_dir}/.github/ISSUE_TEMPLATE" => Utils\mustache_render( "{$template_path}/github-issue-template.mustache" ),
			"{$package_dir}/.github/PULL_REQUEST_TEMPLATE" => Utils\mustache_render( "{$template_path}/github-pull-request-template.mustache" ),
			"{$package_dir}/.github/settings.yml" => Utils\mustache_render( "{$template_path}/github-settings.mustache", $settings_vars ),
		);
		$files_written = $this->create_files( $create_files, $force );
		if ( empty( $files_written ) ) {
			WP_CLI::log( 'Package GitHub configuration generation skipped.' );
		} else {
			WP_CLI::success( 'Created package GitHub configuration.' );
		}
	}
public function package_github( $args, $assoc_args ) {
		list( $package_dir ) = $args;

		if ( is_file( $package_dir ) ) {
			$package_dir = dirname( $package_dir );
		} else if ( is_dir( $package_dir ) ) {
			$package_dir = rtrim( $package_dir, '/' );
		}

		self::check_if_valid_package_dir( $package_dir );

		$force = Utils\get_flag_value( $assoc_args, 'force' );
		$template_path = dirname( dirname( __FILE__ ) ) . '/templates';

		$composer_obj = json_decode( file_get_contents( $package_dir . '/composer.json' ), true );
		$settings_vars = array(
			'has_description' => false,
			'description'     => '',
			'has_labels'      => true,
			'labels'          => array(
				array(
					'name'    => 'bug',
					'color'   => 'fc2929'
				),
				array(
					'name'    => 'scope:documentation',
					'color'   => '0e8a16'
				),
				array(
					'name'    => 'scope:testing',
					'color'   => '5319e7'
				),
				array(
					'name'    => 'good-first-issue',
					'color'   => 'eb6420',
				),
				array(
					'name'    => 'help-wanted',
					'color'   => '159818',
				),
				array(
					'name'    => 'maybelater',
					'color'   => 'c2e0c6',
				),
				array(
					'name'    => 'state:unconfirmed',
					'color'   => 'bfe5bf'
				),
				array(
					'name'    => 'state:unsupported',
					'color'   => 'bfe5bf'
				),
				array(
					'name'    => 'wontfix',
					'color'   => 'c2e0c6',
				),
			),
		);
		if ( ! empty( $composer_obj['description'] ) ) {
			$settings_vars['description'] = $composer_obj['description'];
			$settings_vars['has_description'] = true;
		}
		if ( ! empty( $composer_obj['extra']['commands'] ) ) {
			foreach ( $composer_obj['extra']['commands'] as $cmd ) {
				$settings_vars['labels'][] = array(
					'name'  => 'command:' . str_replace( ' ', '-', $cmd ),
					'color' => 'c5def5',
				);
			}
		}
		$create_files = array(
			"{$package_dir}/.github/ISSUE_TEMPLATE" => Utils\mustache_render( "{$template_path}/github-issue-template.mustache" ),
			"{$package_dir}/.github/PULL_REQUEST_TEMPLATE" => Utils\mustache_render( "{$template_path}/github-pull-request-template.mustache" ),
			"{$package_dir}/.github/settings.yml" => Utils\mustache_render( "{$template_path}/github-settings.mustache", $settings_vars ),
		);
		$files_written = $this->create_files( $create_files, $force );
		if ( empty( $files_written ) ) {
			WP_CLI::log( 'Package GitHub configuration generation skipped.' );
		} else {
			WP_CLI::success( 'Created package GitHub configuration.' );
		}
	}
public function package_github ( $ args , $ assoc_args ) { list ( $ package_dir ) = $ args ; if ( is_file ( $ package_dir ) ) { $ package_dir = dirname ( $ package_dir ) ; } else if ( is_dir ( $ package_dir ) ) { $ package_dir = rtrim ( $ package_dir , '/' ) ; } self :: check_if_valid_package_dir ( $ package_dir ) ; $ force = Utils \ get_flag_value ( $ assoc_args , 'force' ) ; $ template_path = dirname ( dirname ( __FILE__ ) ) . '/templates' ; $ composer_obj = json_decode ( file_get_contents ( $ package_dir . '/composer.json' ) , true ) ; $ settings_vars = array ( 'has_description' => false , 'description' => '' , 'has_labels' => true , 'labels' => array ( array ( 'name' => 'bug' , 'color' => 'fc2929' ) , array ( 'name' => 'scope:documentation' , 'color' => '0e8a16' ) , array ( 'name' => 'scope:testing' , 'color' => '5319e7' ) , array ( 'name' => 'good-first-issue' , 'color' => 'eb6420' , ) , array ( 'name' => 'help-wanted' , 'color' => '159818' , ) , array ( 'name' => 'maybelater' , 'color' => 'c2e0c6' , ) , array ( 'name' => 'state:unconfirmed' , 'color' => 'bfe5bf' ) , array ( 'name' => 'state:unsupported' , 'color' => 'bfe5bf' ) , array ( 'name' => 'wontfix' , 'color' => 'c2e0c6' , ) , ) , ) ; if ( ! empty ( $ composer_obj [ 'description' ] ) ) { $ settings_vars [ 'description' ] = $ composer_obj [ 'description' ] ; $ settings_vars [ 'has_description' ] = true ; } if ( ! empty ( $ composer_obj [ 'extra' ] [ 'commands' ] ) ) { foreach ( $ composer_obj [ 'extra' ] [ 'commands' ] as $ cmd ) { $ settings_vars [ 'labels' ] [ ] = array ( 'name' => 'command:' . str_replace ( ' ' , '-' , $ cmd ) , 'color' => 'c5def5' , ) ; } } $ create_files = array ( "{$package_dir}/.github/ISSUE_TEMPLATE" => Utils \ mustache_render ( "{$template_path}/github-issue-template.mustache" ) , "{$package_dir}/.github/PULL_REQUEST_TEMPLATE" => Utils \ mustache_render ( "{$template_path}/github-pull-request-template.mustache" ) , "{$package_dir}/.github/settings.yml" => Utils \ mustache_render ( "{$template_path}/github-settings.mustache" , $ settings_vars ) , ) ; $ files_written = $ this -> create_files ( $ create_files , $ force ) ; if ( empty ( $ files_written ) ) { WP_CLI :: log ( 'Package GitHub configuration generation skipped.' ) ; } else { WP_CLI :: success ( 'Created package GitHub configuration.' ) ; } }
Generate GitHub configuration files for your command.

Creates a variety of files to better manage your project on GitHub. These
files include:

* `.github/ISSUE_TEMPLATE` - Text displayed when a user opens a new issue.
* `.github/PULL_REQUEST_TEMPLATE` - Text displayed when a user submits a pull request.
* `.github/settings.yml` - Configuration file for the [Probot settings app](https://probot.github.io/apps/settings/).

## OPTIONS

<dir>
: Directory path to an existing package to generate GitHub configuration for.

[--force]
: Overwrite files that already exist.

@when       before_wp_load
@subcommand package-github
Generate GitHub configuration files for your command .