Skip to content

Commit

Permalink
Properly handles bad input by skipping instead of overwritting.
Browse files Browse the repository at this point in the history
  • Loading branch information
masom committed Dec 8, 2011
1 parent 59f3023 commit 761c39f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion console/command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ protected function _save(array $params = array()) {
if (file_exists($file)) {
$prompt = "{$file} already exists. Overwrite?";
$choices = array('y', 'n');
if ($this->in($prompt, compact('choices')) == 'n') {
if ($this->in($prompt, compact('choices')) != 'y') {
return "{$params['class']} skipped.";
}
}
Expand Down
2 changes: 1 addition & 1 deletion console/command/create/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function _save(array $params = array()) {
if (file_exists($file)) {
$prompt = "{$file} already exists. Overwrite?";
$choices = array('y', 'n');
if ($this->in($prompt, compact('choices')) == 'n') {
if ($this->in($prompt, compact('choices')) != 'y') {
return "{$params['file']} skipped.";
}
}
Expand Down

0 comments on commit 761c39f

Please sign in to comment.