Bat 文件不会等待完成前面的脚本,而是不会完整执行
我尝试运行的脚本是:
@echo off
flutter create project
timeout 25 /timeout
chdir "project\lib"
md module_name && chdir module_name
md "domain/entities","domain/repositories"
md "data"
md "presentation/pages/page_name/controllers"
exit
它可以正常创建一个 flutter 项目,但是其他一切都无法运行。如果我从文件中删除 flutter 项目的创建,仅执行以下操作,它也会成功运行:
@echo off
md module_name && chdir module_name
md "domain/entities","domain/repositories"
md "data"
md "presentation/pages/page_name/controllers"
exit
成功创建如下目录结构:
module_name
|
|__domain
| |
| |__entities
| |__repositories
|
|__presentation
| |
| |__pages
| |
| |__page_name
| |__controllers
|
|__data
如何让文件中的所有内容运行?
在“flutter create”之前使用“call”对我有用。我还删除了“超时”行
感谢所有回复的人。该文件如下所示:
@echo off
call flutter create project
chdir "project\lib"
md module_name && chdir module_name
md "domain/entities","domain/repositories"
md "data"
md "presentation/pages/page_name/controllers"
exit