Skip to content

Commit 9d0164c

Browse files
authored
Update SOCKET_CLI_COANA_LOCAL_PATH to support the Coana CLI binary (#917)
1 parent b315e9a commit 9d0164c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/dlx.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,17 @@ export async function spawnCoanaDlx(
216216
const localCoanaPath = process.env['SOCKET_CLI_COANA_LOCAL_PATH']
217217
// Use local Coana CLI if path is provided.
218218
if (localCoanaPath) {
219+
const isBinary = !localCoanaPath.endsWith('.js') && !localCoanaPath.endsWith('.mjs');
220+
219221
const finalEnv = {
220222
...process.env,
221223
...constants.processEnv,
222224
...mixinsEnv,
223225
...spawnEnv,
224226
}
225-
const spawnResult = await spawn('node', [localCoanaPath, ...args], {
227+
228+
const spawnArgs = isBinary ? args : [localCoanaPath, ...args];
229+
const spawnResult = await spawn(isBinary ? localCoanaPath : 'node', spawnArgs, {
226230
cwd: dlxOptions.cwd,
227231
env: finalEnv,
228232
stdio: spawnExtra?.['stdio'] || 'inherit',

0 commit comments

Comments
 (0)