瀏覽代碼

Do not capture stderr when reading heroku config.

Akinori MUSHA 10 年之前
父節點
當前提交
4ea8752b91
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      bin/setup_heroku

+ 6 - 2
bin/setup_heroku

@@ -10,7 +10,11 @@ unless `which heroku` =~ /heroku/
 end
 
 def capture(cmd, opts = {})
-  o, s = Open3.capture2e(cmd, opts)
+  if opts.delete(:no_stderr)
+    o, s = Open3.capture2(cmd, opts)
+  else
+    o, s = Open3.capture2e(cmd, opts)
+  end
   o.strip
 end
 
@@ -33,7 +37,7 @@ def yes?(question)
 end
 
 def grab_heroku_config!
-  config_data = capture("heroku config -s")
+  config_data = capture("heroku config -s", no_stderr: true)
   $config = {}
   if config_data !~ /has no config vars/
     config_data.split("\n").map do |line|