Skip to content

Commit

Permalink
fix builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Strencher committed Nov 5, 2023
1 parent 8a0ec70 commit d1a8962
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/run-bdbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const argv = process.argv.slice(2);

// supported: `trigger`, `plugin`.
const cliSwitches = Object.assign(...argv.filter(arg => arg.startsWith("--")).map(arg =>
({ [arg.slice(2, arg.indexOf("="))]: arg.slice(1 + arg.indexOf("=")) })
({[arg.slice(2, arg.indexOf("="))]: arg.slice(1 + arg.indexOf("="))})
));

const isManualRun = "workflow_dispatch" === cliSwitches.trigger;
Expand Down Expand Up @@ -68,7 +68,8 @@ function buildPlugin(pluginName) {
console.log(`Building ${pluginName}...`);

if (newPlugins.includes(pluginName)) {
const loc = _path.resolve(process.cwd(), `builds/${pluginName}.plugin.js`);
const config = require(_path.resolve(process.cwd(), pluginName, "package.json"));
const loc = _path.resolve(process.cwd(), `builds/${config.name}.plugin.js`);
_cp.execSync("node scripts/new-builder.js --input " + pluginName, {
cwd: ".",
stdio: ["ignore", "inherit", "inherit"]
Expand All @@ -81,7 +82,7 @@ function buildPlugin(pluginName) {
cwd: pluginName,
stdio: ["ignore", "inherit", "inherit"]
});

_cp.execSync(`npx bdbuilder --plugin="${pluginName}" --build --config=bdbuilder.prod.config.json`, {
cwd: ".",
stdio: ["ignore", "inherit", "inherit"]
Expand All @@ -95,15 +96,15 @@ function buildPlugin(pluginName) {
*/
function cleanup() {
_fs.readdirSync(".").filter(dirname => !changedPlugins.includes(dirname)).forEach(dirname => {
_fs.rmSync(dirname, { force: true, recursive: true });
_fs.rmSync(dirname, {force: true, recursive: true});
});

for (const pluginName of changedPlugins) {
_fs.readdirSync(pluginName).filter(filename =>
filename !== "assets" &&
!releaseExtensions.some(extension => filename.endsWith(extension))
).forEach(filename => {
_fs.rmSync(_path.resolve(pluginName, filename), { force: true, recursive: true });
_fs.rmSync(_path.resolve(pluginName, filename), {force: true, recursive: true});
});
}
}

0 comments on commit d1a8962

Please sign in to comment.