We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b9ce9b commit 4399e80Copy full SHA for 4399e80
lib/jekyll/commands/draft.rb
@@ -19,8 +19,6 @@ def self.init_with_program(prog)
19
def self.process(args = [], options = {})
20
raise ArgumentError.new('You must specify a name.') if args.empty?
21
22
- Dir.mkdir("_drafts") unless Dir.exist?("_drafts")
23
-
24
type = options["type"] || Jekyll::Compose::DEFAULT_TYPE
25
layout = options["layout"] || Jekyll::Compose::DEFAULT_LAYOUT
26
@@ -31,6 +29,7 @@ def self.process(args = [], options = {})
31
29
32
30
raise ArgumentError.new("A draft already exists at ./#{draft_path}") if File.exist?(draft_path) and !options["force"]
33
+ Dir.mkdir("_drafts") unless Dir.exist?("_drafts")
34
File.open(draft_path, "w") do |f|
35
f.puts(front_matter(layout, title))
36
end
0 commit comments