MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / copyResources

Function copyResources

esbuild.js:8–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const watch = process.argv.includes('--watch');
7
8function copyResources() {
9 const destDir = path.join(__dirname, 'dist', 'resources');
10 fs.mkdirSync(destDir, { recursive: true });
11
12 const resources = [
13 './node_modules/jquery/dist/jquery.min.js',
14 './node_modules/jquery.json-viewer/json-viewer',
15 './node_modules/ag-grid-community/dist/ag-grid-community.min.noStyle.js',
16 './node_modules/ag-grid-community/styles/ag-grid.min.css',
17 './node_modules/ag-grid-community/styles/ag-theme-balham.min.css'
18 ];
19
20 for (const res of resources) {
21 const srcPath = path.resolve(__dirname, res);
22 const destName = path.basename(srcPath);
23 const destPath = path.resolve(destDir, destName);
24 if (fs.existsSync(srcPath)) {
25 fs.cpSync(srcPath, destPath, { recursive: true });
26 } else {
27 console.warn(`Warning: Resource not found: ${srcPath}`);
28 }
29 }
30 console.log('Resources copied.');
31}
32
33async function main() {
34 copyResources();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected