Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Consume VS Code built-in extensions in Che-Theia
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
  • Loading branch information
vzhukovs committed Jan 31, 2020
1 parent 491cdef commit 3224b55
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions generator/src/foreach_yarn
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}`);
}
});

Expand All @@ -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));
}
});
}

0 comments on commit 3224b55

Please sign in to comment.