[Groonga-commit] droonga/grn2drn at 055fc72 [master] Create output directory automatically

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jul 17 21:39:33 JST 2014


Kouhei Sutou	2014-07-17 21:39:33 +0900 (Thu, 17 Jul 2014)

  New Revision: 055fc72ed3bcb477a995e4828d641a1bdc965e67
  https://github.com/droonga/grn2drn/commit/055fc72ed3bcb477a995e4828d641a1bdc965e67

  Message:
    Create output directory automatically

  Modified files:
    bin/grn2drn

  Modified: bin/grn2drn (+2 -0)
===================================================================
--- bin/grn2drn    2014-07-17 21:38:08 +0900 (31cd0cb)
+++ bin/grn2drn    2014-07-17 21:39:33 +0900 (c3b8907)
@@ -17,6 +17,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 require "ostruct"
+require "fileutils"
 require "optparse"
 
 require "grn2drn/version"
@@ -89,6 +90,7 @@ def open_output(path)
   if path == "-"
     yield($stdout)
   else
+    FileUtils.mkdir_p(File.dirname(path))
     File.open(path, "w") do |output|
       yield(output)
     end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index