hertz icon indicating copy to clipboard operation
hertz copied to clipboard

fix: correct saving of custom file paths

Open nnothing1 opened this issue 4 months ago • 2 comments

What type of PR is this?

Check the PR title.

  • [x] This PR title match the format: <type>(optional scope): <description>
  • [x] The description of this PR title is user-oriented and clear enough for others to understand.
  • [x] Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: In the package template, adding {{.ProjectDir}} introduced absolute paths, but file generation still used relative paths, which resulted in incorrect paths like "/path/to/rel/path/to/rel". This change normalizes path handling during processing to ensure generated file paths are correct.

zh(optional): 在 package 模板中 添加 {{.ProjectDir}} ,会给path带上绝对路径,但是生成文件时又按相对路径生成,从而导致路径不正确(“/path/to/rel/path/to/rel ”绝对路径套绝对路径),因此在 handle 时统一路径格式,确保生成文件路径正确。

(Optional) Which issue(s) this PR fixes:

Fixes #1428

(Optional) The PR that updates user documentation:

nnothing1 avatar Sep 19 '25 19:09 nnothing1

lgtm

HeyJavaBean avatar Sep 22 '25 09:09 HeyJavaBean

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 74.98%. Comparing base (b2a99fc) to head (a38697c). :warning: Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1434      +/-   ##
===========================================
+ Coverage    74.16%   74.98%   +0.82%     
===========================================
  Files          147      147              
  Lines        16988    14190    -2798     
===========================================
- Hits         12599    10641    -1958     
+ Misses        3794     2954     -840     
  Partials       595      595              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Sep 22 '25 09:09 codecov[bot]