Skip to content

改善启动脚本导出#5906

Open
WhatDamon wants to merge 10 commits intoHMCL-dev:mainfrom
WhatDamon:export
Open

改善启动脚本导出#5906
WhatDamon wants to merge 10 commits intoHMCL-dev:mainfrom
WhatDamon:export

Conversation

@WhatDamon
Copy link
Copy Markdown
Contributor

@WhatDamon WhatDamon commented Apr 4, 2026

Resolve #5200

下图已过期,对话框已删除

当无法判断应该导出什么格式的启动脚本时,直接基于操作系统添加合适的后缀

同时把 bash 这个后缀也纳入了可通过检测确定文件后缀的范围

@WhatDamon
Copy link
Copy Markdown
Contributor Author

CC @3gf8jv4dv 或许需要检查本地化文件

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 4, 2026

我觉得做个弹窗的必要性不大,而且会给用户造成困惑。我们可以考虑

  1. 自动对没有后缀的文件添加后缀;
  2. 增强对各种后缀的支持(比如 .command)。

@WhatDamon
Copy link
Copy Markdown
Contributor Author

WhatDamon commented Apr 4, 2026 via email

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 4, 2026

Windows 上 bat 更合适,ps1 默认情况下应该没办法双击运行。

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 5, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces automatic file extension validation for launch scripts, appending a default extension if the provided one is invalid for the current operating system. It also expands the allowed extensions on macOS/Linux to include ".bash". The review feedback correctly identifies that the extension checks are case-sensitive, which could cause issues with uppercase extensions; using case-insensitive comparisons is suggested to improve robustness.

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.

[Bug] 生成启动脚本时若无.sh后缀则导出失败

3 participants