Skip to content

answering to a CMD y/n prompt #57

@alaa-fouzai

Description

@alaa-fouzai

hello

i was using this library and its quite good

but unfortunately the command im using prompts me to accept or deny via y/n

image

i was wondering if the library allows me to answer to this prompt
if it is possible can you provide me with a sample code ,all i found is retrieving the process id
is there a way to reconnect and answer y to the process ?

i already tried this
const syncDir=cmd.run('cd ../tools/ && ffmpeg -i input.mkv -t 10 test3.mkv' ,function(err, data, stderr){ console.log('running'); console.log('data ',data); console.log('stderr ',stderr); console.log('err ',err); if ( stderr.includes('already exists. Overwrite ? [y/N]')) { data.stdin.write("y"); console.log('accepting '); } });

but i couldn't make it work
if its not possible i can work around it but i wanted to check with you guys beforehand

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions