Skip to content

Commit f599e2a

Browse files
motiz88facebook-github-bot
authored andcommitted
Fix custom prebuilt binary handling in unstable_prepareDebuggerShell (#53927)
Summary: Pull Request resolved: #53927 Changelog: [Internal] Fixes a bug that broke `unstable_prepareDebuggerShell` (and therefore the RNDT shell) in OSS. Reviewed By: vzaidman Differential Revision: D83178777 fbshipit-source-id: cfd93b14e2a94e36d8a3ee9f4605036a4279ef8c
1 parent b577679 commit f599e2a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/debugger-shell/src/node/index.flow.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,12 @@ async function unstable_prepareDebuggerShell(
116116
flavor: DebuggerShellFlavor,
117117
{prebuiltBinaryPath}: {prebuiltBinaryPath?: string} = {},
118118
): Promise<DebuggerShellPreparationResult> {
119-
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
120-
flavor,
121-
prebuiltBinaryPath,
122-
);
123-
124119
try {
125120
switch (flavor) {
126121
case 'prebuilt':
127-
const prebuiltResult =
128-
await prepareDebuggerShellFromDotSlashFile(binaryPath);
122+
const prebuiltResult = await prepareDebuggerShellFromDotSlashFile(
123+
prebuiltBinaryPath ?? DEVTOOLS_BINARY_DOTSLASH_FILE,
124+
);
129125
if (prebuiltResult.code !== 'success') {
130126
return prebuiltResult;
131127
}
@@ -136,6 +132,11 @@ async function unstable_prepareDebuggerShell(
136132
flavor as empty;
137133
throw new Error(`Unknown flavor: ${flavor}`);
138134
}
135+
136+
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
137+
flavor,
138+
prebuiltBinaryPath,
139+
);
139140
const {code, stderr} = await spawnAndGetStderr(binaryPath, [
140141
...baseArgs,
141142
'--version',

0 commit comments

Comments
 (0)