-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·33 lines (26 loc) · 803 Bytes
/
Copy pathscript.js
File metadata and controls
executable file
·33 lines (26 loc) · 803 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
26
27
28
29
30
31
32
33
var fs = require("fs");
var path = require("path");
var rootPath = path.join(__dirname);
var _rootPath = rootPath+"/components"
readDirSync(_rootPath)
function readDirSync(path){
var pa = fs.readdirSync(path);
var _arr = []
pa.forEach(function(ele,index){
var info = fs.statSync(path+"/"+ele)
if(info.isDirectory()){
// console.log(">>>>>>>>>>>>>>>>>>>>>>>> dir: "+ele)
readDirSync(path+"/"+ele);
}else{
if(ele.indexOf(".less")!==-1){
// console.log("所在位置:",path);
// console.log("mac file: "+ele);
var newPath = path.replace(rootPath+"/components",rootPath+"/dist");
// console.log("新地址是:",newPath);
// 复制
fs.copyFileSync(path+"/"+ele, newPath+"/"+ele);
}
}
});
// console.log("read end");
}