forked from ksky521/nodeppt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy.js
executable file
·38 lines (35 loc) · 1.05 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
const path = require('path')
const libDir = path.join(__dirname, path.sep)
const $ = require('./helper')
const rootDir = path.join(libDir, '../', path.sep)
module.exports = function (destDir) {
destDir = $.getDirPath(destDir)
let 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
let configs = ['config.json']
configs.map(function (filename) {
let filepath = path.join(rootDir, filename)
$.copy(filepath, path.join(destDir, filename))
})
}