Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadableStream for CLI #818

Closed
thienpow opened this issue Jul 12, 2020 · 1 comment
Closed

ReadableStream for CLI #818

thienpow opened this issue Jul 12, 2020 · 1 comment

Comments

@thienpow
Copy link

thienpow commented Jul 12, 2020

it would be good to be able to get ReadableStream from CLI function call.

let streamResult[]

let res = await process.execute("ipfs", ["add", `${file.path}`])
let reader = res.progress.getReader()  //not necessary be named as "progress", maybe "status"
while (true) {
  const {done, value} = await reader.read();
  if (done) {
     break;
  }
  
  .... then, push the value chunk to streamResult[]
 }

some vital data of a status like after calling to "ipfs daemon" is needed, currently it won't even return a single line of result, because it stay running, so the call never come back, it only comeback when it is terminated or crashed... actually this could be listed as bug, bcos the Rust code stay waiting there forever for the daemon.

@lucasfernog
Copy link
Member

Closed by #1408. Check out https://tauri.studio/en/docs/api/js/modules/shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants