Skip to content

Commit

Permalink
Fix checking for "flex-require-dev" in composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 23, 2021
1 parent 3f0dc66 commit 99e3323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function update(Event $event, $operations = [])
$contents = file_get_contents($file);
$json = JsonFile::parseJson($contents);

if (!isset($json['flex-require']) && !isset($json['flex-require'])) {
if (!isset($json['flex-require']) && !isset($json['flex-require-dev'])) {
$this->unpack($event);

return;
Expand Down
4 changes: 2 additions & 2 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function shouldWriteFile(string $file, bool $overwrite): bool
exec('git status --short --ignored --untracked-files=all -- '.ProcessExecutor::escape($file).' 2>&1', $output, $status);

if (0 !== $status) {
return (bool) $this->io && $this->io->askConfirmation(sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ', $file), false);
return $this->io && $this->io->askConfirmation(sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ', $file), false);
}

if (empty($output[0]) || preg_match('/^[ AMDRCU][ D][ \t]/', $output[0])) {
Expand All @@ -78,7 +78,7 @@ public function shouldWriteFile(string $file, bool $overwrite): bool
$name = basename($file);
$name = \strlen($output[0]) - \strlen($name) === strrpos($output[0], $name) ? substr($output[0], 3) : $name;

return (bool) $this->io && $this->io->askConfirmation(sprintf('File "%s" has uncommitted changes, overwrite? [y/N] ', $name), false);
return $this->io && $this->io->askConfirmation(sprintf('File "%s" has uncommitted changes, overwrite? [y/N] ', $name), false);
}

public function toArray(): array
Expand Down

0 comments on commit 99e3323

Please sign in to comment.