fix(cli): 修复 taro init 自定义模板源时未正确解析zip包的问题 #14041
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个 PR 做了什么? (简要描述所做更改)
执行
taro init
创建项目时,选择自定义模板源,无论使用「单模板」或「模板组」的 url 模板源(.zip文件),均无法正确执行初始化命令。原因是,taro 将 zip 包直接解包至 taro-temp 临时文件夹中,导致执行
readDirWithFileTypes
方法获取文件夹名称时错误,误认为zip包结构不正确,从而异常。本 PR 经修复后,结果如下:
单模板
单模板时,给出
from-remote-url
的临时选项名称,辅助用户选择模板组
以上 zip 包均为直接从 git 仓库中下载的 .zip 文件
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: