Last active
February 27, 2019 17:56
-
-
Save nullvariable/a33b9a5bbbddf1d91b8b8164dd6b7663 to your computer and use it in GitHub Desktop.
use wp-cli as a proxy for typerocket galaxy commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
} ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hat tip to @mbucurcf for this handy snippet