merge all dist folders into one
This commit is contained in:
@@ -108,14 +108,19 @@ export const ciBuildPluginTask = new Task<PluginCIOptions>('Build Plugin', build
|
|||||||
const bundlePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
const bundlePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
const workDir = getWorkFolder();
|
const workDir = getWorkFolder();
|
||||||
let distDir = path.resolve(workDir, 'build', 'dist');
|
|
||||||
if (!fs.existsSync(distDir)) {
|
// Copy all `dist` folders to a single dist folder
|
||||||
distDir = `${process.cwd()}/dist`;
|
const distDir = path.resolve(workDir, 'dist');
|
||||||
if (!fs.existsSync(distDir)) {
|
fs.mkdirSync(distDir, { recursive: true });
|
||||||
throw new Error('Dist folder does not exist: ' + distDir);
|
const dirs = fs.readdirSync(workDir);
|
||||||
|
for (const dir of dirs) {
|
||||||
|
if (dir.startsWith('build_')) {
|
||||||
|
const contents = path.resolve(dir, 'dist');
|
||||||
|
if (fs.existsSync(contents)) {
|
||||||
|
await execa('cp', ['-rp', contents, distDir]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO -- merge all the build/xxx/dist folders
|
|
||||||
|
|
||||||
// Create an artifact
|
// Create an artifact
|
||||||
const artifactsDir = path.resolve(workDir, 'artifacts');
|
const artifactsDir = path.resolve(workDir, 'artifacts');
|
||||||
|
|||||||
Reference in New Issue
Block a user