Skip to content

[break]fix: make renameAsset use newName semantics#539

Merged
star-e merged 1 commit intococos:mainfrom
Changdw:feature/renameAsset
May 8, 2026
Merged

[break]fix: make renameAsset use newName semantics#539
star-e merged 1 commit intococos:mainfrom
Changdw:feature/renameAsset

Conversation

@Changdw
Copy link
Copy Markdown
Contributor

@Changdw Changdw commented May 7, 2026

renameAsset 从“目标路径语义”收敛为“newName 语义”:

  • source 支持 path / uuid / url
  • newName 仅用于同目录改名,文件名需包含后缀
  • 跨目录移动改由 moveAsset 负责
  • 补充了 rename 相关测试,覆盖冲突重命名和非法 newName 场景

Comment thread src/lib/assets/assets.ts
newName: string,
options: AssetOperationOption = {}
): Promise<any> {
return await assetManager.renameAsset(source, target, options);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

接口级别的修改,需要改 sdk 支持 PinK 的版本号,这个 pr 要先挂着,等一下 PinK 适配好了,再合并

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照约定,pr 名称加上 [break] 前缀即可

@star-e star-e added the pending Not ready yet label May 8, 2026
@Changdw Changdw changed the title fix: make renameAsset use newName semantics [break]fix: make renameAsset use newName semantics May 8, 2026
@star-e star-e merged commit 38c4b0d into cocos:main May 8, 2026
6 checks passed
@star-e star-e removed the pending Not ready yet label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants