Skip to content

Commit 20cb39c

Browse files
committed
refactor: apply simplify pass
Hoist targetPlatform() to a single const in copyRtkBinary instead of calling it three times across the copy, chmod, and darwin-signing steps. Generated-By: PostHog Code Task-Id: b86391cc-4634-4a2b-ae34-fe1f9c0626a0
1 parent 1fced7a commit 20cb39c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/code/vite-main-plugins.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ export function copyRtkBinary(): Plugin {
261261
return;
262262
}
263263

264+
const platform = targetPlatform();
264265
copyFileSync(source, destBinary);
265-
if (targetPlatform() !== "win32") {
266+
if (platform !== "win32") {
266267
execSync(`chmod +x "${destBinary}"`);
267268
}
268-
if (targetPlatform() === "darwin") {
269+
if (platform === "darwin") {
269270
try {
270271
execSync(`xattr -cr "${destBinary}"`, { stdio: "inherit" });
271272
execSync(`codesign --force --sign - "${destBinary}"`, {

0 commit comments

Comments
 (0)