forked from angular/angular-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy-libs.js
35 lines (30 loc) · 936 Bytes
/
copy-libs.js
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
26
27
28
29
30
31
32
33
34
35
'use strict';
// Constants
const baseSrcDir = 'node_modules';
const baseDstDir = 'app/lib';
const files = [
'html5-boilerplate/dist/css/main.css',
'html5-boilerplate/dist/css/normalize.css',
'html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js',
'angular/angular.js',
'angular/angular.min.js',
'angular/angular.min.js.map',
'angular-route/angular-route.js',
'angular-route/angular-route.min.js',
'angular-route/angular-route.min.js.map',
'angular-loader/angular-loader.js',
'angular-loader/angular-loader.min.js',
'angular-loader/angular-loader.min.js.map'
];
// Imports
const path = require('path');
const shx = require('shelljs');
// Copy lib files
shx.rm('-rf', baseDstDir);
for (let relPath of files) {
const srcPath = path.join(baseSrcDir, relPath);
const dstPath = path.join(baseDstDir, relPath);
const dstDir = path.dirname(dstPath);
shx.mkdir('-p', dstDir);
shx.cp(srcPath, dstDir);
}