-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🔧 Allow overwriting experiments and features during development (#2…
…0843) * Allow overwriting experiments via special file * Allow feature overwriting via .features.dev * Adjust to discussion
- Loading branch information
Tim Roes
authored
Jan 17, 2023
1 parent
3c39e0c
commit f104508
Showing
4 changed files
with
43 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const EXPERIMENTS_FILE = path.resolve(__dirname, "../.experiments.json"); | ||
|
||
if (fs.existsSync(EXPERIMENTS_FILE)) { | ||
console.log("\nOverwriting experiments from .experiments.json ..."); | ||
const overwrites = require(EXPERIMENTS_FILE); | ||
|
||
if (Object.keys(overwrites).length) { | ||
console.log(`Overwriting experiments with the following values:\n\n${JSON.stringify(overwrites, null, 2)}`); | ||
process.env.REACT_APP_EXPERIMENT_OVERWRITES = JSON.stringify(overwrites); | ||
} | ||
} |
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