add check to filter out custom scripts in eject command (#2562)

This commit is contained in:
Paweł Jędrzejczyk
2017-06-27 15:11:14 +02:00
committed by Dan Abramov
parent 41f2013260
commit 0644e80d36

View File

@@ -169,6 +169,9 @@ inquirer
Object.keys(appPackage.scripts).forEach(key => {
Object.keys(ownPackage.bin).forEach(binKey => {
const regex = new RegExp(binKey + ' (\\w+)', 'g');
if (!regex.test(appPackage.scripts[key])) {
return;
}
appPackage.scripts[key] = appPackage.scripts[key].replace(
regex,
'node scripts/$1.js'