-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build
changes cwd
#1186
Comments
@breavyn PR would be great. But before that would like to understand how this is a bug? How does saving and restoring the cwd lead to buggy behaviour with respect to the built application? |
The nwjs application itself is built correctly. However, silently changing the cwd is hostile to users trying to call I propose either not changing the cwd in the first place, which is a trivial change. Or clearly documenting that this is intended behaviour, suggesting the user save and restore the cwd themselves if needed. const cwd = process.cwd();
await nwbuild({...});
process.chdir(cwd); Keeping in mind changing this behaviour would break scripts relying on the cwd change. |
@breavyn I understand now, please go ahead with the pull request.
I think as long as the application builds correctly in managed manifest mode, it should be fine. |
🤖 I have created a release *beep* *boop* --- ## [4.8.1](v4.8.0...v4.8.1) (2024-08-05) ### Bug Fixes * **bld:** maintain cwd when using managedManifest or nativeAddon ([#1187](#1187)) ([40223db](40223db)), closes [#1186](#1186) ### Chores * **deps:** bump the npm group across 1 directory with 6 updates ([#1185](#1185)) ([f4c0822](f4c0822)) * **deps:** remove unused cli-progress package ([8f4e07d](8f4e07d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Issue Type
Current/Missing Behaviour
Calling
nwbuild
withmode: "build"
andmanageManifest
will change the processes cwd to use the package manager. This requires the caller to save and restore the cwd when usingnwbuild
.nw-builder/src/bld.js
Line 233 in 8f4e07d
A similar issue exists here also.
nw-builder/src/bld.js
Line 421 in 8f4e07d
Expected/Proposed Behaviour
The package manager should be executed with the needed cwd, without changing the calling processes cwd.
I can submit a PR if desired.
The text was updated successfully, but these errors were encountered: