5989: create directory structure for temp files
authorNico Cesar <nico@curoverse.com>
Wed, 1 Jul 2015 20:23:33 +0000 (16:23 -0400)
committerNico Cesar <nico@curoverse.com>
Wed, 1 Jul 2015 20:23:33 +0000 (16:23 -0400)
refs #5989 bug_1

docker/api/update-gitolite.rb

index 82479319360b8fef8fe0f112931c1fe94d0a1991..a1500e0da1c82953530edba781c787528a4fe09d 100755 (executable)
@@ -5,6 +5,7 @@ require 'pp'
 require 'arvados'
 require 'tempfile'
 require 'yaml'
+require 'fileutils'
 
 # This script does the actual gitolite config management on disk.
 #
@@ -54,6 +55,7 @@ end
 def replace_file(path, contents)
   unlink_now = true
   dirname, basename = File.split(path)
+  FileUtils.mkpath(dirname)
   new_file = Tempfile.new([basename, ".tmp"], dirname)
   begin
     new_file.write(contents)