每次我尝试构建generate-all命令时,它都会提示我覆盖?[y,n,a]进行输入。有没有办法默认选择“y”。
编辑: 我是第一次设置框架,并且经常更改模型并生成 View 和 Controller 进行检查。
更新:选择选项“a”,它将自动覆盖所有文件,而不是每次都提示。
最佳答案
如果您通过 Google 到达这里。
新的 grails (3.x) 具有 regenerate generated files 的“-force”选项
$ grails generate-all bookstore.Author
Warning |
Destination file grails-app\controllers\bookstore\AuthorController.groovy already exists, skipping...
Warning |
Destination file src\test\groovy\bookstore\AuthorControllerSpec.groovy already exists, skipping...
Warning |
Destination file grails-app\views\author\edit.gsp already exists, skipping...
Warning |
Destination file grails-app\views\author\create.gsp already exists, skipping...
Warning |
Destination file grails-app\views\author\index.gsp already exists, skipping...
Warning |
Destination file grails-app\views\author\show.gsp already exists, skipping...
|Scaffolding completed for grails-app\domain\bookstore\Author.groovy
$ grails generate-all -force bookstore.Author
|Rendered template Controller.groovy to destination grails-app\controllers\bookstore\AuthorController.groovy
|Rendered template Spec.groovy to destination src\test\groovy\bookstore\AuthorControllerSpec.groovy
|Rendered template edit.gsp to destination grails-app\views\author\edit.gsp
|Rendered template create.gsp to destination grails-app\views\author\create.gsp
|Rendered template index.gsp to destination grails-app\views\author\index.gsp
|Rendered template show.gsp to destination grails-app\views\author\show.gsp
|Scaffolding completed for grails-app\domain\bookstore\Author.groovy
关于Grails - 生成全部继续而不提示覆盖?[y,n,a],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27957554/