-
-
Notifications
You must be signed in to change notification settings - Fork 828
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 check the version of babel cli
Because the package has changed so npm can't just auto-upgrade, so this at least tells people how to fix it when the upgrade breaks it for everybody.
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var exec = require('child_process').exec; | ||
|
||
// Makes sure the babel executable in the path is babel 6 (or greater), not | ||
// babel 5, which it is if you upgrade from an older version of react-sdk and | ||
// run 'npm install' since the package has changed to babel-cli, so 'babel' | ||
// remains installed and the executable in node_modules/.bin remains as babel | ||
// 5. | ||
|
||
exec("babel -V", function (error, stdout, stderr) { | ||
if (parseInt(stdout.substr(0,1), 10) < 6) { | ||
console.log("\033[31m\033[1m"+ | ||
'*****************************************\n'+ | ||
'* matrix-react-sdk has moved to babel 6 *\n'+ | ||
'* Please "rm -rf node_modules && npm i" *\n'+ | ||
'*****************************************\n'+ | ||
"\033[91m"); | ||
process.exit(1); | ||
} | ||
}); |
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