create-guten-block
Version:
Create a WordPress Gutenberg Block plugin with Zero-Config #OCJS, Webpack, React, ES6/7/8/Next, ESLint, Babel, and more.
31 lines (25 loc) • 601 B
JavaScript
/**
* Install a starter .gitignore
*/
;
const path = require( 'path' );
const fs = require( 'fs-extra' );
const shell = require( 'shelljs' );
module.exports = (blockDir) => {
shell.cd( blockDir );
shell.touch( '.gitignore' );
// Build a default .gitignore
const ignore = [
'node_modules\n',
'## Uncomment line below if you prefer to',
'## keep compiled files out of version control',
'# dist/'
].join('\n');
return new Promise( async resolve => {
await fs.writeFileSync(
path.join( process.cwd(), '.gitignore' ),
ignore + '\n'
);
resolve( true );
} );
};