diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-06-24 18:53:45 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-06-24 18:53:45 +0200 |
commit | d1f1241d9ecab1a75b95898722794f99045ccc5e (patch) | |
tree | 67e132763e12c6ad03b5387c1a1b1ebbe5f7b324 | |
parent | ff37e0e505811e14a203d8bf9213e8a5d0343acc (diff) |
ircbot.rb: create the appropriate directories when updating botclass dir from template
-rw-r--r-- | lib/rbot/ircbot.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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.." |