forked from ksky521/nodeppt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy.js
executable file
·39 lines (35 loc) · 1.11 KB
/
copy.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
36
37
38
39
var fs = require('fs');
var path = require('path');
var libDir = __dirname + path.sep;
var $ = require('./helper');
var rootDir = path.join(libDir, '../') + path.sep;
module.exports = function(destDir) {
destDir = $.getDirPath(destDir);
var assetsDir = rootDir + 'assets';
//复制assets文件夹
$.copy(assetsDir, path.join(destDir, 'assets'), function(filename, dir, subdir) {
if (!subdir) {
return false;
}
return true;
});
//复制template文件夹
$.copy(rootDir + 'template', path.join(destDir, 'template'), function(filename, dir, subdir) {
if (!subdir && filename === 'default.ejs') {
return false;
}
return true;
});
//复制ppts文件夹
$.copy(rootDir + 'ppts', path.join(destDir, 'ppts'), function(filename, dir, subdir) {
if (!subdir && filename === 'demo.html') {
return false;
}
return true;
});
//复制config.json
['config.json'].map(function(filename) {
filepath = rootDir + filename;
$.copy(filepath, path.join(destDir, filename));
});
}