Skip to content

Commit

Permalink
Merge branch 'context-menu-api-fix' of https://github.com/YofukashiNo…
Browse files Browse the repository at this point in the history
…/replugged into context-menu-api-fix
  • Loading branch information
yofukashino committed Jul 6, 2024
2 parents d3f66b2 + e9c279e commit 8aa10b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 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
2 changes: 0 additions & 2 deletions src/renderer/coremods/contextMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
} from "../../../types/coremods/contextMenu";
import { Logger } from "../../modules/logger";


const logger = Logger.api("ContextMenu");

export const menuItems = {} as Record<
Expand Down Expand Up @@ -108,7 +107,6 @@ export function _buildPatchedMenu(menu: ContextMenuData): React.ReactElement | n
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!menuItems[navId] || !MenuGroup) return <ContextMenu {...menu} plugged={true} />;


// The data as passed as Arguments from the calling function, so we just grab what we want from it
const data = menu.data[0];

Expand Down

0 comments on commit 8aa10b6

Please sign in to comment.