Skip to content

Waiting for a process spawned by dcli exec #262

Closed Answered by Mikescops
sbaldrich asked this question in Q&A
Discussion options

You must be logged in to vote

I need to test more but updating with this seems to work:

    const child = spawnSync(command, {
        stdio: 'inherit',
        shell: true,
        env: environmentVariables,
    });

    if (child.error) {
        logger.error(`Failed to execute command: ${child.error.message}`);
    }

That way the parent program is forced to wait for the child to exit.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@Mikescops
Comment options

@Mikescops
Comment options

Answer selected by sbaldrich
Comment options

You must be logged in to vote
3 replies
@Mikescops
Comment options

@Mikescops
Comment options

@Mikescops
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants