mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 09:18:11 -05:00
Fail if destination directory for jekyll new exists and is not empty. Fixes #981.
This commit is contained in:
@@ -8,6 +8,10 @@ module Jekyll
|
||||
|
||||
new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
|
||||
FileUtils.mkdir_p new_blog_path
|
||||
unless Dir["#{new_blog_path}/**/*"].empty?
|
||||
Jekyll::Logger.error "Conflict:", "#{new_blog_path} exists and is not empty."
|
||||
exit(1)
|
||||
end
|
||||
|
||||
create_sample_files new_blog_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user