1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict';
|
6 |
|
7 | const path = require( 'path' );
|
8 | const fs = require( 'fs-extra' );
|
9 | const shell = require( 'shelljs' );
|
10 |
|
11 | module.exports = (blockDir) => {
|
12 | shell.cd( blockDir );
|
13 | shell.touch( '.gitignore' );
|
14 |
|
15 |
|
16 | const ignore = [
|
17 | 'node_modules\n',
|
18 | '## Uncomment line below if you prefer to',
|
19 | '## keep compiled files out of version control',
|
20 | '# dist/'
|
21 | ].join('\n');
|
22 |
|
23 | return new Promise( async resolve => {
|
24 | await fs.writeFileSync(
|
25 | path.join( process.cwd(), '.gitignore' ),
|
26 | ignore + '\n'
|
27 | );
|
28 | resolve( true );
|
29 | } );
|
30 | };
|