Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Add a script to warn about Container fixture regen
- Loading branch information
1 parent
060c602
commit a98636e
Showing
2 changed files
with
25 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const chalk = require('chalk') | ||
|
||
var execSync = require('child_process').execSync | ||
|
||
var stdout = execSync( | ||
'git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD' | ||
) | ||
|
||
const yellow = str => console.log(chalk.yellow(str)) | ||
const green = str => console.log(chalk.green(str)) | ||
|
||
for (const platform of ['android', 'ios']) { | ||
const containerGenModule = `ern-container-gen-${platform}` | ||
if (stdout && stdout.includes(containerGenModule)) { | ||
yellow('!===========================================================!') | ||
yellow(`Changes detected in ${containerGenModule}.`) | ||
yellow('If the changes are impacting Container generated content,') | ||
yellow(`dont forget to regenerate ${platform} Container fixture.`) | ||
yellow(`In doubt ? Just regenerate the fixture :)`) | ||
green(`$ yarn regen-fixtures`) | ||
yellow('!===========================================================!') | ||
} | ||
} |