Skip to content

Commit

Permalink
Merge branch 'main' into context-menu-api-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino authored Jun 26, 2024
2 parents 8254073 + 40eb0a4 commit dff6ede
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions bin/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async function handleContexts(
if (watch) {
await context.watch();
} else {
await context.rebuild().catch(() => {});
await context.rebuild().catch(() => process.exit(1));
context.dispose();
}
}),
Expand Down Expand Up @@ -364,7 +364,9 @@ async function buildPlugin({ watch, noInstall, production, noReload, addon }: Ar
const install: esbuild.Plugin = {
name: "install",
setup: (build) => {
build.onEnd(async () => {
build.onEnd(async (result) => {
if (result.errors.length > 0) return;

if (!noInstall) {
const dest = path.join(CONFIG_PATH, "plugins", manifest.id);
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
Expand Down Expand Up @@ -452,7 +454,9 @@ async function buildTheme({ watch, noInstall, production, noReload, addon }: Arg
const install: esbuild.Plugin = {
name: "install",
setup: (build) => {
build.onEnd(async () => {
build.onEnd(async (result) => {
if (result.errors.length > 0) return;

if (!noInstall) {
const dest = path.join(CONFIG_PATH, "themes", manifest.id);
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
Expand Down
6 changes: 4 additions & 2 deletions scripts/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ rmSync("replugged.asar", { force: true });
const preBundle: esbuild.Plugin = {
name: "preBundle",
setup: (build) => {
build.onEnd(() => {
build.onEnd((result) => {
if (result.errors.length > 0) return;

if (!existsSync(`${distDir}/i18n`)) {
mkdirSync(`${distDir}/i18n`);
}
Expand Down Expand Up @@ -114,7 +116,7 @@ await Promise.all(
if (watch) {
await context.watch();
} else {
await context.rebuild().catch(() => {});
await context.rebuild().catch(() => process.exit(1));
context.dispose();
}
}),
Expand Down

0 comments on commit dff6ede

Please sign in to comment.