From c20aa94701fd2163d4abefcc1074b9b2c416c6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=B9=96=E4=B9=89=E6=B0=94?= Date: Wed, 31 Jan 2024 11:26:36 +0800 Subject: [PATCH] fix:choice_question --- src/Commands/ModelGen.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Commands/ModelGen.php b/src/Commands/ModelGen.php index 65ba47a..9d556d6 100644 --- a/src/Commands/ModelGen.php +++ b/src/Commands/ModelGen.php @@ -54,6 +54,15 @@ protected function generateCode() echo "The following files will be generated:\n"; $skipAll = null; $answers = []; + $choice_question = <<getRelativePath(); if (is_file($file->path)) { @@ -71,13 +80,7 @@ protected function generateCode() $answers[$file->id] = !$skipAll; } else { do { - $answer = $this->choice("Do you want to overwrite this file? - y:Overwrite this file. - n:Skip this file. - ya:Overwrite this and the rest of the changed files. - na:Skip this and the rest of the changed files. - v:View difference - ", [ + $answer = $this->choice($choice_question, [ 'y' , 'n' , 'ya' ,