Skip to content

Commit 1c348cc

Browse files
committed
Clarify that .exe files don't need shell mode on Windows
Script files (.bat, .cmd, .ps1) require shell: true, but .exe files are actual binaries that can be spawned directly without shell.
1 parent 9c13685 commit 1c348cc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

registry/src/lib/dlx-binary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ export async function dlxBinary(
249249
const cacheDir = getDlxCachePath()
250250
const cacheKey = generateCacheKey(url)
251251
const cacheEntryDir = path.join(cacheDir, cacheKey)
252-
const platformKey = `${targetPlatform}-${arch}`
253-
const binaryName = name || `binary-${platformKey}`
252+
const binaryName = name || `binary-${targetPlatform}-${arch}`
254253
const binaryPath = normalizePath(path.join(cacheEntryDir, binaryName))
255254

256255
let downloaded = false
@@ -296,6 +295,7 @@ export async function dlxBinary(
296295

297296
// Execute the binary.
298297
// On Windows, script files (.bat, .cmd, .ps1) require shell: true.
298+
// Note: .exe files are actual binaries and don't need shell mode.
299299
const finalSpawnOptions =
300300
WIN32 && /\.(?:bat|cmd|ps1)$/i.test(binaryPath)
301301
? { ...spawnOptions, shell: true }

0 commit comments

Comments
 (0)