Skip to content

Commit 4b9ce9b

Browse files
campoparkr
authored andcommitted
Create _drafts folder if it does not exist
- When using the drafts command, if the _drafts folder does not already exist, create it. This prevents errors when running the draft command for the first time on Jekyll 2.5.3.
1 parent 4c1949b commit 4b9ce9b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/jekyll-compose/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Jekyll
22
module Compose
3-
VERSION = "0.2.0"
3+
VERSION = "0.2.1"
44
end
55
end

lib/jekyll/commands/draft.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def self.init_with_program(prog)
1919
def self.process(args = [], options = {})
2020
raise ArgumentError.new('You must specify a name.') if args.empty?
2121

22+
Dir.mkdir("_drafts") unless Dir.exist?("_drafts")
23+
2224
type = options["type"] || Jekyll::Compose::DEFAULT_TYPE
2325
layout = options["layout"] || Jekyll::Compose::DEFAULT_LAYOUT
2426

0 commit comments

Comments
 (0)