forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.js
More file actions
20 lines (18 loc) · 706 Bytes
/
publish.js
File metadata and controls
20 lines (18 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const path = require('path');
const fse = require('fs-extra')
const key = process.argv[2] ? process.argv[2].replace("--", "") : "leaflet";
const sourceDir = path.join(__dirname, "../dist/" + key);
const destDir = path.join(__dirname, "../src/" + key + "/dist");
fse.removeSync(destDir);
fse.copySync(sourceDir, destDir, {
filter: (src) => {
return !(src.indexOf("include-") >= 0 || src.indexOf("resources") >= 0)
}
});
if (key === 'mapboxgl') {
// 拷贝resources文件夹到src/mapboxgl
const source = path.join(__dirname, "../dist/resources");
const target = path.join(__dirname, "../src/mapboxgl/resources");
fse.removeSync(target);
fse.copySync(source, target);
}