Commit e9ab3871ace4af262d42f4fcd0f2997db7bf862f

Thomas de Grivel 2023-02-25T23:35:08

log

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/rbpkg/log.rb b/lib/rbpkg/log.rb
index 4426772..6ceab40 100644
--- a/lib/rbpkg/log.rb
+++ b/lib/rbpkg/log.rb
@@ -54,6 +54,8 @@ EOF
     end
 
     def puts(string)
+      dir = File.dirname(path)
+      cmd! "mkdir -p #{sh_quote(dir)}" unless File.directory?(dir)
       File.open(path, "a") do |output|
         output.puts string
       end