2018-05-10 19:17:28 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
const execSync = require( 'child_process' ).execSync;
|
|
|
|
const readline = require( 'readline-sync' );
|
|
|
|
|
|
|
|
console.log( '\nBy contributing to this project, you license the materials you contribute ' +
|
|
|
|
'under the GNU General Public License v2 (or later). All materials must have ' +
|
|
|
|
'GPLv2 compatible licenses — see .github/CONTRIBUTING.md for details.\n\n' );
|
|
|
|
|
|
|
|
const currentBranch = execSync( 'git rev-parse --abbrev-ref HEAD' ).toString().trim();
|
|
|
|
|
2020-06-17 17:39:41 +00:00
|
|
|
if ( 'main' === currentBranch ) {
|
|
|
|
if ( ! readline.keyInYN( "You're about to push !!![ main ]!!!, is that what you intended?" ) ) {
|
2018-05-10 19:17:28 +00:00
|
|
|
process.exit( 1 );
|
|
|
|
}
|
|
|
|
}
|