diff options
-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.." |