software-mansion / react-native-ide

https://ide.swmansion.com
Other
705 stars 21 forks source link

Override PWD variable when launching subprocess from different directory #369

Closed kmagiera closed 2 weeks ago

kmagiera commented 2 weeks ago

This PR fixes an issue with some modules that use the following pattern for accessing the project directory: https://github.com/zoontek/react-native-bootsplash/blob/master/src/generate.ts#L23

In that pattern PWD env variable takes precedence over process.cwd. However, this PWD variable may be inherited from the parent process and should not be passed down to child process when launched with cwd option.

This PR fixes this problem, by overriding PWD variable to point to cwd varlue when both are set. We also add stderr reading to metro subprocess such that it outputs error messages to the IDE logger.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 9:12am