question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

try to writing to no exit pipe

See original GitHub issue

Thanks for fixed #76 . I use v5.1.1 and run the same pipe code

onchange -v \"**/*/*.scss\" \"**/*/*.css\" -o \"> task/css.txt\" -- echo {{changed}}

css.txt still no content and I get those message

> onchange -v "**/*/*.scss" "**/*/*.css" -o "> task/css.txt" -- echo {{changed}}

onchange: watching **/*/*.scss, **/*/*.css
onchange: "mobile\test\css\style-edit.css" -> change
onchange: executing outpipe "E:\Program Files\nodejs\node.exe E:\Snow.Huang\project\dev\CampaignBuildTool\node_modules\onchange\echo.js > task/css.txt"
onchange: executing command "echo mobile\test\css\style-edit.css"
onchange: "mobile\test\css\style-edit.css" -> change
'E:\Program' ���O�����Υ~���R�O�B�i���檺�{���Χ妸�ɡC
onchange: outpipe completed with 1
程序嘗試寫入到一個不存在的管道。(try to writing to no exit pipe)
onchange: command completed with 0

after I try running this code

onchange -v \"**/*/*.scss\" \"**/*/*.css\" -o \"echo {{changed}} > task/css.txt\"

css.txt is witted and exit code looks fine!

> onchange -v "**/*/*.scss" "**/*/*.css" -o "echo {{changed}} > task/css.txt"

onchange: watching **/*/*.scss, **/*/*.css
onchange: "mobile\test\css\style-edit.css" -> change
onchange: executing outpipe "echo mobile\test\css\style-edit.css > task/css.txt"
onchange: outpipe completed with 0

what’s happen in first code?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
blakeembreycommented, Nov 26, 2018

@betsu Thanks! That makes sense. Looks like an escaping issue, I’ll look into how to better fix that.

1reaction
betsucommented, Nov 26, 2018

Hi @blakeembrey, v4 have same problem and message for me. 5.1.2 it’s work fine! but still have one problem: I use win10. when ${process.execPath} has space in string that make error for me.

onchange: watching **/*/*.{scss,css}
onchange: "css\style-edit.css" -> change
onchange: executing outpipe "E:\Program Files\nodejs\node.exe E:\Snow.Huang\project\dev\CampaignBuildTool\node_modules\onchange\echo.js > task/css.txt"
onchange: executing command "echo css\style-edit.css"
'E:\Program' ���O�����Υ~���R�O�B�i���檺�{���Χ妸�ɡC
onchange: outpipe completed with 1
onchange: command completed with 0

try to writing to no exit pipe looks fixed! then I try to fixed ${process.execPath} problem with add double quotes

const ECHO_CMD = `${process.execPath} ${resolve(__dirname, 'echo.js')}
to
const ECHO_CMD = `\"${process.execPath}\" ${resolve(__dirname, 'echo.js')}

and running.

> onchange -v --await-write-finish -o "> task/css.txt" "**/*/*.{scss,css}" -e "**/*/{style,style-source}.css" -- echo {{changed}}

onchange: watching **/*/*.{scss,css}
onchange: "css\style-edit.css" -> change
onchange: executing outpipe ""E:\Program Files\nodejs\node.exe" E:\Snow.Huang\project\dev\CampaignBuildTool\node_modules\onchange\echo.js > task/css.txt"
onchange: executing command "echo css\style-edit.css"
onchange: command completed with 0
onchange: outpipe completed with 0

Oh! success!!

P.S. In line 68 childOutpipe.stdin.end() maybe change to this.childOutpipe.stdin.end()

Read more comments on GitHub >

github_iconTop Results From Across the Web

bash - Exit when one process in pipe fails - Stack Overflow
The broken pipe, however, does not terminate command1 . This will only happen when it tries to write to the broken pipe, upon...
Read more >
make tail -f exit on a broken pipe - Unix & Linux Stack Exchange
it never exits. tail does not stop even though the pipe is broken. Does anybody know how to make tail exit when sed...
Read more >
Working with pipes - IBM
Pipes are unnamed objects created to allow two processes to communicate. One process reads and the other process writes to the pipe file....
Read more >
bash - How can I fix a Broken Pipe error? - Super User
The write error: Broken pipe message refers to a writing process that tries to write to a pipe with no readers left on...
Read more >
6.2.2 Creating Pipes in C
To create a simple pipe with C, we make use of the pipe() system call. ... the output side of pipe */ write(fd[1],...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found