You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exec returns a promise to the underlying WebSocket, not to the command execution. If you want to wait for the command execution to complete, you need to wait on that callback that you passed in (the function that calls fs.createReadStream(...)
You need to create a Promise before you make the call to exec and then resolve that promise within the callback. Then wait for that promise to complete before you move on after the exec
async function func1() {
const command = ['tar', 'zcf', '-'];
command.push('-C', cwd);
command.push(srcPath);
const writerStream = fs.createWriteStream(srcPath+".tar")
const errStream = new WritableStreamBuffer();
}
func1()
fs.rmSync(srcPath+".tar"(
I run the above code, fs.rmSync throws the tar file does not exist error, I feel the command is not executed immediately after exec finishes
The text was updated successfully, but these errors were encountered: