From 5fb1ae2700b47a6cd62c3aefb2d8cfdc35fdc0e2 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 16:43:37 -0400 Subject: [PATCH 1/4] Adding support for installing a specific version of Mantle via the command --- src/class-install-command.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/class-install-command.php b/src/class-install-command.php index 60f449f..8561a84 100644 --- a/src/class-install-command.php +++ b/src/class-install-command.php @@ -30,7 +30,7 @@ protected function configure() { ->addOption( 'install', 'i', InputOption::VALUE_NONE, 'Install WordPress in the current location if it doesn\'t exist.' ) ->addOption( 'no-must-use', 'no-mu', InputOption::VALUE_OPTIONAL, 'Don\'t load Mantle as a must-use plugin.', false ) ->addOption( 'dev', 'd', InputOption::VALUE_NONE, 'Setup mantle for development on the framework.' ) - ->addOption( 'setup-dev', null, InputOption::VALUE_NONE, '(Legacy) setup mantle for development on the framework.' ); + ->addOption( 'mantle-version', null, InputOption::VALUE_OPTIONAL, 'Version of alleyinteractive/mantle to install.', 'latest' ); } /** @@ -270,14 +270,15 @@ protected function install_mantle( string $dir, InputInterface $input, OutputInt throw new RuntimeException( "Directory is not empty: [{$mantle_dir}]" ); } + $version = $input->getOption( 'mantle-version' ) ? ':' . $input->getOption( 'mantle-version' ) : ''; $composer = $this->find_composer(); $commands = [ - $composer . " create-project alleyinteractive/mantle {$mantle_dir} --remove-vcs --stability=dev --no-interaction --no-scripts", + $composer . " create-project alleyinteractive/mantle{$version} {$mantle_dir} --remove-vcs --stability=dev --no-interaction --no-scripts", "rm -rf {$mantle_dir}/docs", ]; // Setup the application for local development on the framework. - if ( $input->getOption( 'dev' ) || $input->getOption( 'setup-dev' ) ) { + if ( $input->getOption( 'dev' ) ) { if ( is_dir( $framework_dir ) && file_exists( "{$framework_dir}/composer.json" ) ) { throw new RuntimeException( "Mantle Framework is already installed: [{$framework_dir}'" ); } @@ -305,7 +306,7 @@ protected function install_mantle( string $dir, InputInterface $input, OutputInt $output->writeln( "Mantle installed successfully at {$mantle_dir}." ); - if ( $input->getOption( 'setup-dev' ) ) { + if ( $input->getOption( 'dev' ) ) { $output->writeln( "Mantle Framework installed successfully at {$framework_dir}." ); } From 14ca40c7d55d5c2c1e06ec8a1c33f61890a4ea27 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 16:44:05 -0400 Subject: [PATCH 2/4] Testing CI From 062c5203782414f770c11002264e2ed7871c44c3 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 17:01:10 -0400 Subject: [PATCH 3/4] PHPCS fix --- src/class-install-command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class-install-command.php b/src/class-install-command.php index 8561a84..b8bb07e 100644 --- a/src/class-install-command.php +++ b/src/class-install-command.php @@ -270,7 +270,7 @@ protected function install_mantle( string $dir, InputInterface $input, OutputInt throw new RuntimeException( "Directory is not empty: [{$mantle_dir}]" ); } - $version = $input->getOption( 'mantle-version' ) ? ':' . $input->getOption( 'mantle-version' ) : ''; + $version = $input->getOption( 'mantle-version' ) ? ':' . $input->getOption( 'mantle-version' ) : ''; $composer = $this->find_composer(); $commands = [ $composer . " create-project alleyinteractive/mantle{$version} {$mantle_dir} --remove-vcs --stability=dev --no-interaction --no-scripts", From a308e78ce66650c0a3586e587f994efcd73dd94d Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 17:02:34 -0400 Subject: [PATCH 4/4] Bump to 1.0.4 --- bin/mantle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mantle b/bin/mantle index f64e6cb..2202aae 100755 --- a/bin/mantle +++ b/bin/mantle @@ -7,7 +7,7 @@ if ( file_exists( __DIR__ . '/../../../autoload.php' ) ) { require __DIR__ . '/../vendor/autoload.php'; } -$app = new Symfony\Component\Console\Application( 'Mantle Installer', '1.0.3' ); +$app = new Symfony\Component\Console\Application( 'Mantle Installer', '1.0.4' ); $app->add( new Mantle\Installer\Console\Install_Command() ); $app->run();