forked from conwnet/github1s
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy-extensions.js
More file actions
executable file
·32 lines (26 loc) · 870 Bytes
/
Copy pathcopy-extensions.js
File metadata and controls
executable file
·32 lines (26 loc) · 870 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
#!/usr/bin/env node
const path = require('path');
const fs = require('fs-extra');
const APP_ROOT = path.join(__dirname, '../..');
const TARGET_DIR = path.join(APP_ROOT, 'dist/static/extensions');
const enableExtensions =
require(path.join(APP_ROOT, 'resources/builtin-extensions.json')) || [];
const main = () => {
fs.ensureDirSync(TARGET_DIR);
enableExtensions.forEach((extension) => {
fs.copySync(
path.join(APP_ROOT, 'lib/vscode', extension.path),
path.join(TARGET_DIR, path.basename(extension.path)),
{ filter: (src) => !src.includes('node_modules') }
);
});
const extensions = fs.readdirSync(path.join(APP_ROOT, 'extensions'));
extensions.forEach((extension) => {
fs.copySync(
path.join(APP_ROOT, 'extensions', extension),
path.join(TARGET_DIR, extension),
{ filter: (src) => !src.includes('node_modules') }
);
});
};
main();