From c37b9bbe136b4c22b55688f3d3dd40fe88ac4c4e Mon Sep 17 00:00:00 2001 From: borkweb Date: Thu, 2 May 2024 10:21:23 -0400 Subject: [PATCH] Add the clone command and adjust output --- src/App.php | 1 + src/Command/Command.php | 13 ++- src/Commands/Build.php | 2 +- src/Commands/Checks/AbstractCheck.php | 2 +- src/Commands/Checks/Tbd.php | 6 +- src/Commands/Checks/VersionConflict.php | 4 +- src/Commands/Clean.php | 14 ++-- src/Commands/CloneCommand.php | 60 ++++++++++++++ src/Commands/Package.php | 16 ++-- src/Commands/Workflow.php | 2 +- src/Commands/Zip.php | 39 ++++++--- tests/cli/Commands/CloneCest.php | 79 +++++++++++++++++++ ...dCest__it_should_run_build__0.snapshot.txt | 2 +- ...d_steps_when_missing_puprc__0.snapshot.txt | 2 +- ...teps_when_not_set_in_puprc__0.snapshot.txt | 2 +- ...ould_clean_up_after_itself__0.snapshot.txt | 9 ++- ...cific_branch_of_a_git_repo__0.snapshot.txt | 2 + ...fault_branch_of_a_git_repo__0.snapshot.txt | 2 + ..._it_should_package_the_zip__0.snapshot.txt | 15 +++- ..._version_number_if_unknown__0.snapshot.txt | 15 +++- ...ing_file_colon_slash_slash__0.snapshot.txt | 27 +++++-- ...d_zip_with_repo_using_path__0.snapshot.txt | 27 +++++-- ...should_zip_without_cloning__0.snapshot.txt | 27 +++++-- ...ecks_when_checks_are_empty__0.snapshot.txt | 27 +++++-- 24 files changed, 315 insertions(+), 80 deletions(-) create mode 100644 src/Commands/CloneCommand.php create mode 100644 tests/cli/Commands/CloneCest.php create mode 100644 tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt create mode 100644 tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt diff --git a/src/App.php b/src/App.php index 15202a9..24f0ab2 100644 --- a/src/App.php +++ b/src/App.php @@ -56,6 +56,7 @@ public function __construct( string $version ) { $this->add( new Commands\Build() ); $this->add( new Commands\Check() ); $this->add( new Commands\Clean() ); + $this->add( new Commands\CloneCommand() ); $this->add( new Commands\GetVersion() ); $this->add( new Commands\Help() ); $this->add( new Commands\I18n() ); diff --git a/src/Command/Command.php b/src/Command/Command.php index 2c7bbc4..eba7424 100644 --- a/src/Command/Command.php +++ b/src/Command/Command.php @@ -5,7 +5,9 @@ use StellarWP\Pup\App; use Symfony\Component\Console\Command\Command as SymfonyCommand; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; abstract class Command extends SymfonyCommand { /** @@ -18,6 +20,13 @@ abstract class Command extends SymfonyCommand { */ protected $should_validate_puprc = true; + public function __construct( string $name = null ) { + parent::__construct( $name ); + + // Declare options that we want to be able to use globally in workflows without declaring it in each command. + $this->addOption( 'branch', null, InputOption::VALUE_REQUIRED, 'The branch to use.' ); + } + /** * Runs the wrapping execute command. * @@ -47,6 +56,8 @@ protected function execute( InputInterface $input, OutputInterface $output ) { * @return void */ protected function initialize( InputInterface $input, OutputInterface $output ) { + $output->getFormatter()->setStyle( 'info', new OutputFormatterStyle( 'blue' ) ); + $output->getFormatter()->setStyle( 'success', new OutputFormatterStyle( 'green' ) ); $this->io = new Io( $input, $output ); } @@ -65,4 +76,4 @@ protected function getIO(): Io { public function setShouldNotValidatePuprc() { $this->should_validate_puprc = false; } -} \ No newline at end of file +} diff --git a/src/Commands/Build.php b/src/Commands/Build.php index e25d197..8a33565 100644 --- a/src/Commands/Build.php +++ b/src/Commands/Build.php @@ -62,7 +62,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { chdir( $config->getWorkingDir() ); } - $io->writeln( 'Build complete.' ); + $io->writeln( 'Build complete.' ); return 0; } } diff --git a/src/Commands/Checks/AbstractCheck.php b/src/Commands/Checks/AbstractCheck.php index fda888c..73390c6 100644 --- a/src/Commands/Checks/AbstractCheck.php +++ b/src/Commands/Checks/AbstractCheck.php @@ -181,4 +181,4 @@ public function shouldBailOnFailureDev(): bool { protected function writeln( string $message ) { $this->getIO()->writeln( $message ); } -} \ No newline at end of file +} diff --git a/src/Commands/Checks/Tbd.php b/src/Commands/Checks/Tbd.php index 2c388be..613de91 100644 --- a/src/Commands/Checks/Tbd.php +++ b/src/Commands/Checks/Tbd.php @@ -81,7 +81,7 @@ protected function checkExecute( InputInterface $input, Io $output ): int { $output->writeln( '' ); } } else { - $output->writeln( 'No TBDs found!' ); + $output->writeln( 'No TBDs found!' ); $output->writeln( '' ); } $output->writeln( '' ); @@ -89,7 +89,7 @@ protected function checkExecute( InputInterface $input, Io $output ): int { if ( $found_tbds ) { $output->writeln( "TBDs have been found!" ); } else { - $output->writeln( 'Success! No TBDs found.' ); + $output->writeln( 'Success! No TBDs found.' ); } return $found_tbds ? 1 : 0; @@ -168,4 +168,4 @@ protected function scanDir( string $root, string $current_dir, string $scan_dir, return $matched_lines; } -} \ No newline at end of file +} diff --git a/src/Commands/Checks/VersionConflict.php b/src/Commands/Checks/VersionConflict.php index 33b0373..3acb57f 100644 --- a/src/Commands/Checks/VersionConflict.php +++ b/src/Commands/Checks/VersionConflict.php @@ -112,7 +112,7 @@ protected function checkExecute( InputInterface $input, Io $output ): int { return 1; } - $output->writeln( 'No version conflicts found.' ); + $output->writeln( 'No version conflicts found.' ); return 0; } -} \ No newline at end of file +} diff --git a/src/Commands/Clean.php b/src/Commands/Clean.php index 29c5ca7..aefcbdc 100644 --- a/src/Commands/Clean.php +++ b/src/Commands/Clean.php @@ -32,24 +32,22 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $clean_steps = $config->getCleanCommands(); $io = $this->getIO(); - $output->writeln( 'Cleaning up...' ); + $this->io->section( 'Cleaning up...' ); - $output->write( "* Removing zip dir..." ); if ( file_exists( $zip_dir ) && DirectoryUtils::rmdir( $zip_dir ) !== 0 ) { throw new \Exception( "Could not remove {$zip_dir}." ); } - $output->write( 'Complete.' . PHP_EOL ); + $output->writeln( "✓ Removing zip dir...Complete." ); - $output->write( "* Removing build dir..." ); if ( file_exists( $build_dir ) && DirectoryUtils::rmdir( $build_dir ) !== 0 ) { throw new \Exception( "Could not remove {$build_dir}." ); } - $output->write( 'Complete.' . PHP_EOL ); + $output->writeln( "✓ Removing build dir...Complete." ); $pup_distfiles = $config->getWorkingDir() . '.pup-distfiles'; if ( file_exists( $pup_distfiles ) ) { if ( unlink( $pup_distfiles ) ) { - $output->writeln( 'Removing .pup-distfiles...Complete.' ); + $output->writeln( '✓ Removing .pup-distfiles...Complete.' ); } else { throw new \Exception( "Could not remove {$build_dir}." ); } @@ -58,7 +56,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $pup_distignore = $config->getWorkingDir() . '.pup-distignore'; if ( file_exists( $pup_distignore ) ) { if ( unlink( $pup_distignore ) ) { - $output->writeln( 'Removing .pup-distignore...Complete.' ); + $output->writeln( '✓ Removing .pup-distignore...Complete.' ); } else { throw new \Exception( "Could not remove {$build_dir}." ); } @@ -67,7 +65,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $pup_distinclude = $config->getWorkingDir() . '.pup-distinclude'; if ( file_exists( $pup_distinclude ) ) { if ( unlink( $pup_distinclude ) ) { - $output->writeln( 'Removing .pup-distinclude...Complete.' ); + $output->writeln( '✓ Removing .pup-distinclude...Complete.' ); } else { throw new \Exception( "Could not remove {$build_dir}." ); } diff --git a/src/Commands/CloneCommand.php b/src/Commands/CloneCommand.php new file mode 100644 index 0000000..ed0d063 --- /dev/null +++ b/src/Commands/CloneCommand.php @@ -0,0 +1,60 @@ +setName( 'clone' ) + ->setDescription( 'Clone a git repository.' ) + ->setHelp( 'Clone a git repository.' ); + } + + /** + * @inheritDoc + */ + protected function execute( InputInterface $input, OutputInterface $output ) { + parent::execute( $input, $output ); + $config = App::getConfig(); + $build_dir = $config->getBuildDir(); + $branch = $input->getOption( 'branch' ); + + $branch_arg = ''; + if ( $branch ) { + $branch_arg = "-b {$branch}"; + } + + $repo = App::getConfig()->getRepo(); + + if ( file_exists( $build_dir ) ) { + $build_dir_basename = basename( $build_dir ); + $output->writeln( "The {$build_dir_basename} already exists." ); + $output->write( "Removing build dir..." ); + if ( file_exists( $build_dir ) && DirectoryUtils::rmdir( $build_dir ) !== 0 ) { + throw new \Exception( "Could not remove {$build_dir}." ); + } + $output->write( 'Complete.' . PHP_EOL ); + } + + $output->writeln( 'Cloning the ' . $repo . ' repo into ' . App::getConfig()->getBuildDir( false ) . '...' ); + system( 'git clone --quiet --recurse-submodules -j8 --shallow-submodules --depth 1 ' . $branch_arg . ' ' . $repo . ' ' . App::getConfig()->getBuildDir( false ) ); + $output->writeln( '✓ Clone complete.' ); + + return 0; + } +} diff --git a/src/Commands/Package.php b/src/Commands/Package.php index 15daf42..2618b41 100644 --- a/src/Commands/Package.php +++ b/src/Commands/Package.php @@ -66,7 +66,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $config = App::getConfig(); $zip_name = $config->getZipName(); - $output->writeln( 'Packaging zip...' ); + $this->io->section( 'Packaging zip...' ); $buffer = new BufferedOutput(); $application = $this->getApplication(); @@ -77,13 +77,13 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $zip_filename = "{$full_zip_name}.zip"; - $output->write( '* Updating version files...' ); + $output->writeln( '- Updating version files...' ); if ( $version !== 'unknown' ) { $this->updateVersionsInFiles( $version ); } - $output->write( 'Complete.' . PHP_EOL ); + $output->writeln( '✓ Updating version files...Complete.' ); - $output->write( '* Synchronizing files to zip directory...' ); + $output->writeln( '- Synchronizing files to zip directory...' ); $pup_zip_dir = $config->getZipDir(); DirectoryUtils::rmdir( $pup_zip_dir ); @@ -91,25 +91,25 @@ protected function execute( InputInterface $input, OutputInterface $output ) { mkdir( $pup_zip_dir ); $results = $this->syncFiles( $root, $pup_zip_dir ); - $output->write( 'Complete.' . PHP_EOL ); + $output->writeln( '✓ Synchronizing files to zip directory...Complete.' ); if ( $results !== 0 ) { $this->undoChanges(); return $results; } - $output->write( '* Zipping...' ); + $output->writeln( '- Zipping...' ); $results = $this->createZip( $pup_zip_dir, $zip_filename, $zip_name ); if ( $results !== 0 ) { $this->undoChanges(); return $results; } - $output->write( 'Complete.' . PHP_EOL ); + $output->writeln( '✓ Zipping...Complete.' ); $this->undoChanges(); - $this->output->writeln( "Zip {$zip_filename} created!" ); + $this->output->writeln( PHP_EOL . "Zip {$zip_filename} created!" . PHP_EOL ); return 0; } diff --git a/src/Commands/Workflow.php b/src/Commands/Workflow.php index f7f35a6..1bb66ac 100644 --- a/src/Commands/Workflow.php +++ b/src/Commands/Workflow.php @@ -89,7 +89,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { chdir( $config->getWorkingDir() ); } - $io->writeln( 'Workflow complete.' ); + $io->writeln( 'Workflow complete.' ); } return 0; diff --git a/src/Commands/Zip.php b/src/Commands/Zip.php index 4bfdb10..491131e 100644 --- a/src/Commands/Zip.php +++ b/src/Commands/Zip.php @@ -51,16 +51,11 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $branch = $this->input->getArgument( 'branch' ); if ( ! $this->input->getOption( 'no-clone' ) ) { - $branch_arg = ''; - if ( $branch ) { - $branch_arg = "-b {$branch}"; + $results = $this->runClone(); + if ( $results !== 0 ) { + $output->writeln( 'The clone step of `pup zip` failed.' ); + return $results; } - - $repo = App::getConfig()->getRepo(); - - $output->writeln( 'Cloning the ' . $repo . ' repo into ' . App::getConfig()->getBuildDir( false ) . '...' ); - system( 'git clone --quiet --recurse-submodules -j8 --shallow-submodules --depth 1 ' . $branch_arg . ' ' . $repo . ' ' . App::getConfig()->getBuildDir( false ) ); - $output->writeln( 'Clone complete.' ); } elseif ( $branch ) { system( 'git checkout --quiet ' . $branch ); } @@ -164,6 +159,32 @@ protected function runCheck(): int { return $command->run( $command_input, $this->output ); } + /** + * Run the clone command. + * + * @throws \Symfony\Component\Console\Exception\ExceptionInterface + * + * @return int + */ + protected function runClone(): int { + $application = $this->getApplication(); + if ( ! $application ) { + return 1; + } + + $command = $application->find( 'clone' ); + $arguments = []; + + $branch = $this->input->getArgument( 'branch' ); + + if ( $branch ) { + $arguments['--branch'] = $this->input->getArgument( 'branch' ); + } + + $command_input = new ArrayInput( $arguments ); + return $command->run( $command_input, $this->output ); + } + /** * Run the get-version command. * diff --git a/tests/cli/Commands/CloneCest.php b/tests/cli/Commands/CloneCest.php new file mode 100644 index 0000000..7808663 --- /dev/null +++ b/tests/cli/Commands/CloneCest.php @@ -0,0 +1,79 @@ +tests_root . '/_data/fake-project-git-repo'; + system( 'rm -rf ' . $project_path ); + system( 'cp -r ' . $this->tests_root . '/_data/fake-project ' . $project_path ); + + chdir( $project_path ); + + system( 'cd ' . $project_path . ' && git init --quiet' ); + system( 'cd ' . $project_path . ' && git add .' ); + system( 'cd ' . $project_path . ' && git commit -m "Initial commit" --quiet' ); + + $puprc = $this->get_puprc(); + $puprc['repo'] = $project_path; + $this->write_puprc( $puprc, 'fake-project-git-repo' ); + + $I->runShellCommand( "php {$this->pup} clone" ); + $I->seeResultCodeIs( 0 ); + + $I->assertTrue( file_exists( '.pup-build/bootstrap.php' ) ); + + $output = $I->grabShellOutput(); + $this->assertMatchesStringSnapshot( $output ); + + $I->runShellCommand( "php {$this->pup} clean" ); + + $this->reset_data_and_location(); + + system( 'rm -rf ' . $project_path ); + } + + /** + * @test + */ + public function it_should_clone_a_specific_branch_of_a_git_repo( CliTester $I ) { + $project_path = $this->tests_root . '/_data/fake-project-git-repo'; + system( 'rm -rf ' . $project_path ); + system( 'cp -r ' . $this->tests_root . '/_data/fake-project ' . $project_path ); + + chdir( $project_path ); + + system( 'cd ' . $project_path . ' && git init --quiet' ); + system( 'cd ' . $project_path . ' && git add .' ); + system( 'cd ' . $project_path . ' && git commit -m "Initial commit" --quiet' ); + system( 'cd ' . $project_path . ' && git checkout -b other-branch --quiet' ); + system( 'cd ' . $project_path . ' && touch new-file.txt' ); + system( 'cd ' . $project_path . ' && git add new-file.txt' ); + system( 'cd ' . $project_path . ' && git commit new-file.txt -m "Added new file" --quiet' ); + + $puprc = $this->get_puprc(); + $puprc['repo'] = $project_path; + $this->write_puprc( $puprc, 'fake-project-git-repo' ); + + $I->runShellCommand( "php {$this->pup} clone --branch other-branch" ); + $I->seeResultCodeIs( 0 ); + + $I->assertTrue( file_exists( '.pup-build/new-file.txt' ) ); + + $output = $I->grabShellOutput(); + $this->assertMatchesStringSnapshot( $output ); + + $I->runShellCommand( "php {$this->pup} clean" ); + + $this->reset_data_and_location(); + + system( 'rm -rf ' . $project_path ); + } +} diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt index 43cc1a2..a02c5e8 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt @@ -16,4 +16,4 @@ src fake project, yo -Build complete. \ No newline at end of file +✓ Build complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_missing_puprc__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_missing_puprc__0.snapshot.txt index b60408e..46bc566 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_missing_puprc__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_missing_puprc__0.snapshot.txt @@ -1,2 +1,2 @@ Running build steps... -Build complete. \ No newline at end of file +✓ Build complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_not_set_in_puprc__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_not_set_in_puprc__0.snapshot.txt index b60408e..46bc566 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_not_set_in_puprc__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_no_build_steps_when_not_set_in_puprc__0.snapshot.txt @@ -1,2 +1,2 @@ Running build steps... -Build complete. \ No newline at end of file +✓ Build complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/CleanCest__it_should_clean_up_after_itself__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CleanCest__it_should_clean_up_after_itself__0.snapshot.txt index 4ed43b2..7a9d595 100644 --- a/tests/cli/Commands/__snapshots__/CleanCest__it_should_clean_up_after_itself__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/CleanCest__it_should_clean_up_after_itself__0.snapshot.txt @@ -1,4 +1,7 @@ + Cleaning up... -* Removing zip dir...Complete. -* Removing build dir...Complete. -Removing .pup-distignore...Complete. \ No newline at end of file +-------------- + +✓ Removing zip dir...Complete. +✓ Removing build dir...Complete. +✓ Removing .pup-distignore...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt new file mode 100644 index 0000000..e1e56e6 --- /dev/null +++ b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt @@ -0,0 +1,2 @@ +Cloning the /home/matt/git/pup/tests/_data/fake-project-git-repo repo into .pup-build... +✓ Clone complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt new file mode 100644 index 0000000..e1e56e6 --- /dev/null +++ b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt @@ -0,0 +1,2 @@ +Cloning the /home/matt/git/pup/tests/_data/fake-project-git-repo repo into .pup-build... +✓ Clone complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip__0.snapshot.txt index 3e8bce8..d7b3526 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip__0.snapshot.txt @@ -1,5 +1,12 @@ + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.1.0.0.zip created! \ No newline at end of file +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.1.0.0.zip created! diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_without_version_number_if_unknown__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_without_version_number_if_unknown__0.snapshot.txt index f293b43..956010e 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_without_version_number_if_unknown__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_without_version_number_if_unknown__0.snapshot.txt @@ -1,5 +1,12 @@ + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.zip created! \ No newline at end of file +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.zip created! diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt index 4fe1d1e..e8c932e 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt @@ -1,5 +1,5 @@ Cloning the file:///home/matt/git/pup/tests/_data/fake-project-git-repo repo into .pup-build... -Clone complete. +✓ Clone complete. Running build steps... > ls -a @@ -13,7 +13,7 @@ other-file.php package.json src -Build complete. +✓ Build complete. [tbd] Checking for TBDs... [tbd] -------------------- @@ -27,11 +27,22 @@ Build complete. [version-conflict] --------------------------------- [version-conflict] No version conflicts found. + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.1.0.0.1.zip created! +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.1.0.0.1.zip created! + + Cleaning up... -* Removing zip dir...Complete. -* Removing build dir...Complete. \ No newline at end of file +-------------- + +✓ Removing zip dir...Complete. +✓ Removing build dir...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt index c71c260..213de35 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt @@ -1,5 +1,5 @@ Cloning the /home/matt/git/pup/tests/_data/fake-project-git-repo repo into .pup-build... -Clone complete. +✓ Clone complete. Running build steps... > ls -a @@ -13,7 +13,7 @@ other-file.php package.json src -Build complete. +✓ Build complete. [tbd] Checking for TBDs... [tbd] -------------------- @@ -27,11 +27,22 @@ Build complete. [version-conflict] --------------------------------- [version-conflict] No version conflicts found. + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.1.0.0.1.zip created! +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.1.0.0.1.zip created! + + Cleaning up... -* Removing zip dir...Complete. -* Removing build dir...Complete. \ No newline at end of file +-------------- + +✓ Removing zip dir...Complete. +✓ Removing build dir...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt index 4a13324..9b5f7bb 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt @@ -11,7 +11,7 @@ other-file.php package.json src -Build complete. +✓ Build complete. [tbd] Checking for TBDs... [tbd] -------------------- @@ -25,12 +25,23 @@ Build complete. [version-conflict] --------------------------------- [version-conflict] No version conflicts found. + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.1.0.0.1.zip created! +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.1.0.0.1.zip created! + + Cleaning up... -* Removing zip dir...Complete. -* Removing build dir...Complete. -Removing .pup-distignore...Complete. \ No newline at end of file +-------------- + +✓ Removing zip dir...Complete. +✓ Removing build dir...Complete. +✓ Removing .pup-distignore...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt index 3d15ee7..139afa2 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt @@ -11,13 +11,24 @@ other-file.php package.json src -Build complete. +✓ Build complete. + Packaging zip... -* Updating version files...Complete. -* Synchronizing files to zip directory...Complete. -* Zipping...Complete. -Zip fake-project.1.0.0.1.zip created! +---------------- + +- Updating version files... +✓ Updating version files...Complete. +- Synchronizing files to zip directory... +✓ Synchronizing files to zip directory...Complete. +- Zipping... +✓ Zipping...Complete. + +✓ Zip fake-project.1.0.0.1.zip created! + + Cleaning up... -* Removing zip dir...Complete. -* Removing build dir...Complete. -Removing .pup-distignore...Complete. \ No newline at end of file +-------------- + +✓ Removing zip dir...Complete. +✓ Removing build dir...Complete. +✓ Removing .pup-distignore...Complete. \ No newline at end of file