]> khamidou — GitHub mirrors - electron.git/commitdiff
Use dummy stdin stream on Windows.
authorCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 04:13:08 +0000 (12:13 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 04:13:08 +0000 (12:13 +0800)
browser/atom/atom.coffee

index cf86bf1a83391817a1682d583c286ef212d76da8..bde64a3fc77a8b693862fdce488efccbd8760bd7 100644 (file)
@@ -1,12 +1,18 @@
 fs = require 'fs'
 path = require 'path'
 
-# Redirect node's console to use our own implementations, since node can not
-# handle output when running as GUI program.
 if process.platform is 'win32'
+  # Redirect node's console to use our own implementations, since node can not
+  # handle output when running as GUI program.
   console.log = console.error = console.warn = process.log
   process.stdout.write = process.stderr.write = process.log
 
+  # Always returns EOF for stdin stream.
+  Readable = require('stream').Readable
+  stdin = new Readable
+  stdin.push null
+  process.__defineGetter__ 'stdin', -> stdin
+
 # Provide default Content API implementations.
 atom = {}