diff --git a/src/Command/SyncRecipesCommand.php b/src/Command/SyncRecipesCommand.php index 4a3a53a26..3f7f5de22 100644 --- a/src/Command/SyncRecipesCommand.php +++ b/src/Command/SyncRecipesCommand.php @@ -76,6 +76,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io = $this->getIO(); + if (!$io->isVerbose()) { + $io->writeError([ + 'Run command with <info>-v</info> to see more details', + '', + ]); + } + if ($targetPackages = $input->getArgument('packages')) { if ($invalidPackages = array_diff($targetPackages, $totalPackages)) { $io->writeError(sprintf('<warning>Cannot update: some packages are not installed:</warning> %s', implode(', ', $invalidPackages))); diff --git a/src/Configurator/CopyFromPackageConfigurator.php b/src/Configurator/CopyFromPackageConfigurator.php index 3df308f10..75af761a7 100644 --- a/src/Configurator/CopyFromPackageConfigurator.php +++ b/src/Configurator/CopyFromPackageConfigurator.php @@ -22,7 +22,7 @@ class CopyFromPackageConfigurator extends AbstractConfigurator { public function configure(Recipe $recipe, $config, Lock $lock, array $options = []) { - $this->write('Setting configuration and copying files'); + $this->write('Copying files from package'); $packageDir = $this->composer->getInstallationManager()->getInstallPath($recipe->getPackage()); $options = array_merge($this->options->toArray(), $options); @@ -31,7 +31,7 @@ public function configure(Recipe $recipe, $config, Lock $lock, array $options = public function unconfigure(Recipe $recipe, $config, Lock $lock) { - $this->write('Removing configuration and files'); + $this->write('Removing files from package'); $packageDir = $this->composer->getInstallationManager()->getInstallPath($recipe->getPackage()); $this->removeFiles($config, $packageDir, $this->options->get('root-dir')); } @@ -47,7 +47,7 @@ private function copyFiles(array $manifest, string $from, array $options) $targetPath = $this->path->concatenate([$to, $target]); if (!is_dir(\dirname($targetPath))) { mkdir(\dirname($targetPath), 0777, true); - $this->write(sprintf('Created <fg=green>"%s"</>', $this->path->relativize(\dirname($targetPath)))); + $this->write(sprintf(' Created <fg=green>"%s"</>', $this->path->relativize(\dirname($targetPath)))); } $this->copyFile($this->path->concatenate([$from, $source]), $targetPath, $options); @@ -65,7 +65,7 @@ private function removeFiles(array $manifest, string $from, string $to) $targetPath = $this->path->concatenate([$to, $target]); if (file_exists($targetPath)) { @unlink($targetPath); - $this->write(sprintf('Removed <fg=green>"%s"</>', $this->path->relativize($targetPath))); + $this->write(sprintf(' Removed <fg=green>"%s"</>', $this->path->relativize($targetPath))); } } } @@ -83,7 +83,7 @@ private function copyDir(string $source, string $target, array $options) if ($item->isDir()) { if (!is_dir($targetPath)) { mkdir($targetPath); - $this->write(sprintf('Created <fg=green>"%s"</>', $this->path->relativize($targetPath))); + $this->write(sprintf(' Created <fg=green>"%s"</>', $this->path->relativize($targetPath))); } } elseif (!file_exists($targetPath)) { $this->copyFile($item, $targetPath, $options); @@ -104,7 +104,7 @@ public function copyFile(string $source, string $target, array $options) file_put_contents($target, $this->options->expandTargetDir(file_get_contents($source))); @chmod($target, fileperms($target) | (fileperms($source) & 0111)); - $this->write(sprintf('Created <fg=green>"%s"</>', $this->path->relativize($target))); + $this->write(sprintf(' Created <fg=green>"%s"</>', $this->path->relativize($target))); } private function removeFilesFromDir(string $source, string $target) @@ -115,10 +115,10 @@ private function removeFilesFromDir(string $source, string $target) if ($item->isDir()) { // that removes the dir only if it is empty @rmdir($targetPath); - $this->write(sprintf('Removed directory <fg=green>"%s"</>', $this->path->relativize($targetPath))); + $this->write(sprintf(' Removed directory <fg=green>"%s"</>', $this->path->relativize($targetPath))); } else { @unlink($targetPath); - $this->write(sprintf('Removed <fg=green>"%s"</>', $this->path->relativize($targetPath))); + $this->write(sprintf(' Removed <fg=green>"%s"</>', $this->path->relativize($targetPath))); } } } diff --git a/src/Configurator/CopyFromRecipeConfigurator.php b/src/Configurator/CopyFromRecipeConfigurator.php index 322f80466..8671d0e91 100644 --- a/src/Configurator/CopyFromRecipeConfigurator.php +++ b/src/Configurator/CopyFromRecipeConfigurator.php @@ -21,7 +21,7 @@ class CopyFromRecipeConfigurator extends AbstractConfigurator { public function configure(Recipe $recipe, $config, Lock $lock, array $options = []) { - $this->write('Setting configuration and copying files'); + $this->write('Copying files from recipe'); $options = array_merge($this->options->toArray(), $options); $lock->add($recipe->getName(), ['files' => $this->copyFiles($config, $recipe->getFiles(), $options)]); @@ -29,7 +29,7 @@ public function configure(Recipe $recipe, $config, Lock $lock, array $options = public function unconfigure(Recipe $recipe, $config, Lock $lock) { - $this->write('Removing configuration and files'); + $this->write('Removing files from recipe'); $this->removeFiles($config, $this->getRemovableFilesFromRecipeAndLock($recipe, $lock), $this->options->get('root-dir')); } @@ -107,7 +107,7 @@ private function copyFile(string $to, string $contents, bool $executable, array @chmod($to, fileperms($to) | 0111); } - $this->write(sprintf('Created <fg=green>"%s"</>', $this->path->relativize($to))); + $this->write(sprintf(' Created <fg=green>"%s"</>', $this->path->relativize($to))); return $copiedFile; } @@ -141,7 +141,7 @@ private function removeFile(string $to) } @unlink($to); - $this->write(sprintf('Removed <fg=green>"%s"</>', $this->path->relativize($to))); + $this->write(sprintf(' Removed <fg=green>"%s"</>', $this->path->relativize($to))); if (0 === \count(glob(\dirname($to).'/*', GLOB_NOSORT))) { @rmdir(\dirname($to)); diff --git a/src/Configurator/EnvConfigurator.php b/src/Configurator/EnvConfigurator.php index 4ff74899a..0064e4bc0 100644 --- a/src/Configurator/EnvConfigurator.php +++ b/src/Configurator/EnvConfigurator.php @@ -21,7 +21,7 @@ class EnvConfigurator extends AbstractConfigurator { public function configure(Recipe $recipe, $vars, Lock $lock, array $options = []) { - $this->write('Added environment variable defaults'); + $this->write('Adding environment variable defaults'); $this->configureEnvDist($recipe, $vars, $options['force'] ?? false); if (!file_exists($this->options->get('root-dir').'/.env.test')) { @@ -145,7 +145,7 @@ private function unconfigurePhpUnit(Recipe $recipe, $vars) continue; } - $this->write(sprintf('Removed environment variables from %s', $file)); + $this->write(sprintf('Removing environment variables from %s', $file)); file_put_contents($phpunit, $contents); } } diff --git a/src/Configurator/GitignoreConfigurator.php b/src/Configurator/GitignoreConfigurator.php index db57f28ea..b5bf49632 100644 --- a/src/Configurator/GitignoreConfigurator.php +++ b/src/Configurator/GitignoreConfigurator.php @@ -21,7 +21,7 @@ class GitignoreConfigurator extends AbstractConfigurator { public function configure(Recipe $recipe, $vars, Lock $lock, array $options = []) { - $this->write('Added entries to .gitignore'); + $this->write('Adding entries to .gitignore'); $gitignore = $this->options->get('root-dir').'/.gitignore'; if (empty($options['force']) && $this->isFileMarked($recipe, $gitignore)) { @@ -52,7 +52,7 @@ public function unconfigure(Recipe $recipe, $vars, Lock $lock) return; } - $this->write('Removed entries in .gitignore'); + $this->write('Removing entries in .gitignore'); file_put_contents($file, ltrim($contents, "\r\n")); } } diff --git a/src/Configurator/MakefileConfigurator.php b/src/Configurator/MakefileConfigurator.php index 932881fd4..146771b00 100644 --- a/src/Configurator/MakefileConfigurator.php +++ b/src/Configurator/MakefileConfigurator.php @@ -21,7 +21,7 @@ class MakefileConfigurator extends AbstractConfigurator { public function configure(Recipe $recipe, $definitions, Lock $lock, array $options = []) { - $this->write('Added Makefile entries'); + $this->write('Adding Makefile entries'); $makefile = $this->options->get('root-dir').'/Makefile'; if (empty($options['force']) && $this->isFileMarked($recipe, $makefile)) { @@ -65,7 +65,7 @@ public function unconfigure(Recipe $recipe, $vars, Lock $lock) return; } - $this->write(sprintf('Removed Makefile entries from %s', $makefile)); + $this->write(sprintf('Removing Makefile entries from %s', $makefile)); if (!trim($contents)) { @unlink($makefile); } else {