diff --git a/generator/src/foreach_yarn b/generator/src/foreach_yarn index e8c6c06cdd..cb00ed6c12 100755 --- a/generator/src/foreach_yarn +++ b/generator/src/foreach_yarn @@ -9,6 +9,7 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ const fs = require('fs'); +const path = require('path'); const spawnSync = require('child_process').spawnSync; const currentDir = __dirname; @@ -35,6 +36,9 @@ fs.readdirSync(currentDir).forEach((pluginFolderName) => { fs.copyFileSync(`${pluginFolderPath}/${fileName}`, `${targetDir}/${fileName}`); } }) + } else if (fs.existsSync(`${pluginFolderPath}/extension.vsixmanifest`)) { + console.log(`\n✍️ Copying ${pluginFolderPath} VSCode built-in package to ${targetDir}/${pluginFolderName}`); + copyFolderSync(`${pluginFolderPath}`, `${targetDir}/${pluginFolderName}`); } }); @@ -45,3 +49,14 @@ function mkdirSyncRecursive(dir) { curPath.length > 0 && !fs.existsSync(curPath) ? fs.mkdirSync(curPath) : null; } }; + +function copyFolderSync(from, to) { + fs.mkdirSync(to); + fs.readdirSync(from).forEach(element => { + if (fs.lstatSync(path.join(from, element)).isFile()) { + fs.copyFileSync(path.join(from, element), path.join(to, element)); + } else { + copyFolderSync(path.join(from, element), path.join(to, element)); + } + }); +}