Skip to content

Conversation

@nanae772
Copy link
Contributor

内容

#2602 に対する一部対応です。
以下の2つのファイルはpath.joinに置き換えても問題無さそうだったので修正しました。

  • download7z.ts
  • downloadsTypos.ts

置き換えが必要である理由は上記issueに書かれている以下の通りです。

VOICEVOXエディタ内では、path.join(パスの連結)で問題ない箇所でよくpath.resolve(パスの解決)が行われています。
path.resolveは後ろに絶対パスがあった時に予想外の挙動をするので危ない気がします。

join("hoge/fuga", "/piyo.txt")
-> hoge\fuga\piyo.txt

resolve("hoge/fuga", "/piyo.txt")
-> C:\piyo.txt

関連 Issue

#2602

スクリーンショット・動画など

その他

@nanae772 nanae772 requested a review from a team as a code owner March 15, 2025 03:08
@nanae772 nanae772 requested review from Hiroshiba and removed request for a team March 15, 2025 03:08
@voicevox-preview-pages
Copy link

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:00013af

@Hiroshiba Hiroshiba requested a review from Copilot March 15, 2025 13:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors two scripts by replacing occurrences of path.resolve with path.join to ensure safe and expected path concatenation behavior.

  • In tools/downloadTypos.ts, updated path definitions for the binary and version file locations and file deletion operations.
  • In tools/download7z.ts, updated path resolution for distribution paths and file extraction commands.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/downloadTypos.ts Replaced path.resolve with path.join for constructing paths.
tools/download7z.ts Replaced path.resolve with path.join for constructing paths.

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

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

LGTM!!!

変更ありがとうございます、助かります!!!

@Hiroshiba Hiroshiba enabled auto-merge March 15, 2025 13:58
@Hiroshiba Hiroshiba added this pull request to the merge queue Mar 15, 2025
Merged via the queue into VOICEVOX:main with commit b54449b Mar 15, 2025
11 checks passed
@nanae772 nanae772 deleted the replace-resolve-for-join branch March 15, 2025 14:34
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.

2 participants