This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Set INIT_CWD env in all before-* hooks (#480)
In a long living process, where the project can be changed, we need to set the INIT_CWD environment variable in all before-* hooks. Currently it is set only in the `before-watchPatterns` hook. This way, when we use webpack for a project and later we try to use webpack for another project, we try to execute some operations based on the INIT_CWD directory, which still points to our old project. In order to fix this unexpected behavior, set the INIT_CWD in all before-* hooks, as some of them may be skipped based on the state of the project.
- Loading branch information
1 parent
87dd53d
commit b7ef84f
Showing
4 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
const { cleanSnapshotArtefacts } = require("../snapshot/android/project-snapshot-generator"); | ||
const { isAndroid } = require("../projectHelpers"); | ||
const { setProcessInitDirectory } = require("./utils"); | ||
|
||
module.exports = function (hookArgs) { | ||
if (isAndroid(hookArgs.platformInfo.platform)) { | ||
cleanSnapshotArtefacts(hookArgs.platformInfo.projectData.projectDir); | ||
const projectDir = hookArgs.platformInfo.projectData.projectDir; | ||
setProcessInitDirectory(projectDir); | ||
cleanSnapshotArtefacts(projectDir); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters