fix(v2): run pre/post build hooks in project directory instead of bin directory#5215
fix(v2): run pre/post build hooks in project directory instead of bin directory#5215leaanthony wants to merge 1 commit intomasterfrom
Conversation
… directory Build hooks were executing in options.BinDirectory (build/bin) instead of the project root directory. This caused hooks that reference project-local files (like Makefiles) to fail. Fix by using options.ProjectData.Path as the working directory for hook execution. Fixes #3627
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🤖 PR Triage Review ✅ Accepted Runs pre/post build hooks in project directory instead of bin directory (v2 CLI). Fixes build hook execution context. Platform: All (v2, CLI) Next Steps: Dispatching for testing on all platforms. Reviewed by Wails PR Reviewer Bot |
Summary
Fixes #3627
Build hooks were executing in
options.BinDirectory(e.g.,build/bin) instead of the project root directory. This caused hooks that reference project-local files (likeMakefile,package.json, etc.) to fail because the working directory was wrong.Changes
shell.RunCommandcall inexecuteBuildHook()fromoptions.BinDirectorytooptions.ProjectData.Path(v2/pkg/commands/build/build.go:451)v2/test/3627/Test plan
preBuildHooksinwails.jsonthat references a project-local file (e.g.,"*/*": "make lint")wails buildand verify the hook executes in the project root directory