Skip to content

Commit

Permalink
Add support for collections_dir configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Oct 8, 2018
1 parent 7aab81a commit 2965cf6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/jekyll-compose/arg_parser.rb
Expand Up @@ -31,7 +31,8 @@ def force?
end

def source
config["source"].gsub(%r!^#{Regexp.quote(Dir.pwd)}!, "")
File.join(config["source"], config["collections_dir"])
.gsub(%r!^#{Regexp.quote(Dir.pwd)}/*!, "")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-compose/file_creator.rb
Expand Up @@ -30,7 +30,7 @@ def validate_should_write!

def ensure_directory_exists
dir = File.dirname file_path
Dir.mkdir(dir) unless Dir.exist?(dir)
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
end

def write_file
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-compose/movement_arg_parser.rb
Expand Up @@ -8,7 +8,7 @@ def validate!
end

def path
args.join " "
File.join(source, args.join(" ")).sub(%r!\A/!, "")
end
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/jekyll/commands/unpublish.rb
Expand Up @@ -23,7 +23,6 @@ def self.process(args = [], options = {})
params.validate!

movement = PostMovementInfo.new params

mover = PostMover.new movement, params.force?, params.source
mover.move
end
Expand Down

0 comments on commit 2965cf6

Please sign in to comment.