From 2c3092e948b5e86e12a0821fcd64ecd2ea23a2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 23 May 2019 16:14:12 +0200 Subject: [PATCH] Fix: Do not require composer.json to be writable when using --dry-run option --- CHANGELOG.md | 10 +++++++++- src/Command/NormalizeCommand.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e14318..fadf5d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Unreleased -For a full diff see [`1.1.3...1.x`](https://github.com/localheinz/composer-normalize/compare/1.1.3...1.x). +For a full diff see [`1.1.4...1.x`](https://github.com/localheinz/composer-normalize/compare/1.1.4...1.x). + +### [`1.1.4`](https://github.com/localheinz/composer-normalize/releases/tag/1.1.4) + +For a full diff see [`1.1.3...1.1.4`](https://github.com/localheinz/composer-normalize/compare/1.1.3...1.1.4). + +#### Fixed + +* Removed requirement for `composer.json` to be writable when using the `--dry-run` option ([#177](https://github.com/localheinz/composer-normalize/pull/177)), by [@localheinz](https://github.com/localheinz) ### [`1.1.3`](https://github.com/localheinz/composer-normalize/releases/tag/1.1.3) diff --git a/src/Command/NormalizeCommand.php b/src/Command/NormalizeCommand.php index d289a741..36138d9a 100644 --- a/src/Command/NormalizeCommand.php +++ b/src/Command/NormalizeCommand.php @@ -137,7 +137,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O return 1; } - if (!\is_writable($composerFile)) { + if (false === $input->getOption('dry-run') && !\is_writable($composerFile)) { $io->writeError(\sprintf( '%s is not writable.', $composerFile