Skip to content

Instantly share code, notes, and snippets.

@nullvariable
Last active February 27, 2019 17:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nullvariable/a33b9a5bbbddf1d91b8b8164dd6b7663 to your computer and use it in GitHub Desktop.
Save nullvariable/a33b9a5bbbddf1d91b8b8164dd6b7663 to your computer and use it in GitHub Desktop.
use wp-cli as a proxy for typerocket galaxy commands
<?php
if ( defined( 'WP_CLI' ) && WP_CLI ) {
\WP_CLI::add_command( 'galaxy', function () {
$count = count( $_SERVER['argv'] );
for ( $i = 0; $i < $count; $i++ ) {
// strip any preceeding arguments so galaxy isn't confused.
$arg = array_shift( $_SERVER['argv'] );
if ( 'galaxy' == $arg ) {
array_unshift( $_SERVER['argv'], 'galaxy' );
break;
}
} );
}
@nullvariable
Copy link
Author

hat tip to @mbucurcf for this handy snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment