forked from okeydoke/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (20 loc) · 765 Bytes
/
Copy pathindex.js
File metadata and controls
25 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var copy = require('copy-no-overwrite');
var resolve = require('path').resolve;
// copies values from files array two directory's up, which assumes folder
// structure of node_modules/dotfiles/ with this being run as part of npm
// install from the projects root. Ideally we would be getting the base path
// from a process variable or something but haven't figured that out yet
var files = [
'.babelrc',
'.editorconfig',
'.eslintrc',
'.gitattributes',
'browserslist'
];
var basePath = resolve( __dirname, '../..');
files.forEach( function( file ) {
copy( file, resolve( basePath, file) );
});
// So that this repo doesn't ignore files, removed the . from .gitignore,
// when copying it put it back
copy('gitignore', resolve( basePath, '.gitignore' ) );