mirror of
https://github.com/actions/toolkit.git
synced 2026-08-23 00:00:19 +02:00
fix: use detached:true on all platforms for exec stream tests
On Windows, detached:true is needed to properly keep stdio handles open after the parent process exits.
This commit is contained in:
@@ -19,9 +19,14 @@ if (!filePath) {
|
|||||||
// This creates a grandchild process that holds the stdio handles open
|
// This creates a grandchild process that holds the stdio handles open
|
||||||
// after this process (the child) exits
|
// after this process (the child) exits
|
||||||
const waitScript = path.join(__dirname, 'wait-for-file.js')
|
const waitScript = path.join(__dirname, 'wait-for-file.js')
|
||||||
|
const isWindows = process.platform === 'win32'
|
||||||
|
|
||||||
|
// On Windows, use detached:true to properly keep streams open
|
||||||
|
// On Unix, detached:true also works and creates a new process group
|
||||||
const child = childProcess.spawn(process.execPath, [waitScript, `file=${filePath}`], {
|
const child = childProcess.spawn(process.execPath, [waitScript, `file=${filePath}`], {
|
||||||
stdio: ['ignore', 'inherit', 'inherit'],
|
stdio: ['ignore', 'inherit', 'inherit'],
|
||||||
detached: process.platform !== 'win32'
|
detached: true,
|
||||||
|
windowsHide: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// Don't wait for child to exit
|
// Don't wait for child to exit
|
||||||
|
|||||||
Reference in New Issue
Block a user