Created
November 14, 2016 09:16
-
-
Save siassaj/b9aee59b0ff5be9f3ab55bae63eb9f3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def start | |
| write_webpack_config | |
| stdin, stdout_and_stderr, _ = Open3.popen2e(webpack_command) | |
| begin | |
| Timeout::timeout(1) { | |
| while !stdout_and_stderr.eof? | |
| puts stdout_and_stderr.read_nonblock(128) | |
| end | |
| } | |
| rescue Timeout::Error | |
| Signal.trap("INT") { exit } | |
| retry | |
| end | |
| ensure | |
| stdin.close | |
| stdout_and_stderr.close | |
| File.delete config_path | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment