Conversation
|
CC @3gf8jv4dv 或许需要检查本地化文件 |
|
我觉得做个弹窗的必要性不大,而且会给用户造成困惑。我们可以考虑
|
|
其实一开始我就是这么想的,但后面多种原因我考虑了当前的弹窗方案
使用这一方案会有一个问题,默认情况下这几个操作系统应该使用什么后缀?毕竟 FileChooser 应该是不会向应用传递用户选择的文件类型
我目前的想法是 macOS 下默认 `command` ,其他操作系统默认 `sh`,Windows 下我不是很清楚 `bat` 和 `ps1` 哪个更合适 🤔
…---原始邮件---
发件人: ***@***.***>
发送时间: 2026年4月4日(周六) 晚上9:02
收件人: ***@***.***>;
抄送: "Damon ***@***.******@***.***>;
主题: Re: [HMCL-dev/HMCL] 改善启动脚本导出 (PR #5906)
Glavo left a comment (HMCL-dev/HMCL#5906)
我觉得做个弹窗的必要性不大,而且会给用户造成困惑。我们可以考虑
自动对没有后缀的文件添加后缀;
增强对各种后缀的支持(比如 .command)。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Windows 上 |
|
/gemini review |
There was a problem hiding this comment.
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.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a448248b04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| String defaultExt = getDefaultScriptExtension(); | ||
| file = file.resolveSibling(file.getFileName().toString() + "." + defaultExt); |
There was a problem hiding this comment.
Use selected export format when appending missing suffix
When the user saves a launch script without typing an extension, this branch always appends the OS default (bat/command/sh) and ignores which file type was selected in the save dialog. In practice, selecting the *.ps1 filter and saving launch will still produce a non-PowerShell script, silently changing script semantics (and on Windows can re-introduce cmd length limits). The fallback suffix should come from the chooser’s selected extension filter before falling back to OS defaults.
Useful? React with 👍 / 👎.
Resolve #5200
下图已过期,对话框已删除

当无法判断应该导出什么格式的启动脚本时,直接基于操作系统添加合适的后缀
同时把
bash这个后缀也纳入了可通过检测确定文件后缀的范围