From d1f1241d9ecab1a75b95898722794f99045ccc5e Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 24 Jun 2008 18:53:45 +0200 Subject: ircbot.rb: create the appropriate directories when updating botclass dir from template --- lib/rbot/ircbot.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 968f35f9..3cd41d2e 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -427,7 +427,9 @@ class Bot # keywords.rbot, which gets deleted on load and would therefore be missing always missing = Dir.chdir(template) { Dir.glob('*/**') } - Dir.chdir(botclass) { Dir.glob('*/**') } missing.map do |f| - FileUtils.cp File.join(template, f), File.join(botclass, f) + dest = File.join(botclass, f) + FileUtils.mkdir_p File.dirname dest + FileUtils.cp File.join(template, f), dest end else log "no #{botclass} directory found, creating from templates.." -- cgit v1.2.3