Files
paseo/scripts/postinstall-patches.mjs
2026-03-09 12:58:41 +07:00

19 lines
618 B
JavaScript

import { existsSync } from "node:fs";
import { spawnSync } from "node:child_process";
// In CI we often install a single workspace (e.g. server/relay/website). Only apply patches
// when the patched dependency is actually present.
const hasDraggableFlatlist = existsSync("node_modules/react-native-draggable-flatlist");
if (!hasDraggableFlatlist) {
process.exit(0);
}
const isWindows = process.platform === "win32";
const cmd = isWindows ? "patch-package.cmd" : "patch-package";
const result = spawnSync(cmd, [], {
shell: isWindows,
stdio: "inherit",
windowsHide: true,
});
process.exit(result.status ?? 1);