Skip to content

Commit

Permalink
review-init copy doc files, ref #918
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmsnr committed Jan 14, 2018
1 parent a542176 commit 8013f09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/review-init
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def main
opts.on('-f', '--force', 'generate files (except *.re) if directory has already existed.') { @force = true }
opts.on('-l', '--locale', 'generate locale.yml file.') { @locale = true }
opts.on('', '--epub-version VERSION', 'define EPUB version') { |version| @epub_version = version }
opts.on('', '--without-doc', 'generate doc files') { @without_doc = true }
begin
opts.parse!
rescue OptionParser::ParseError => err
Expand Down Expand Up @@ -57,6 +58,7 @@ def main
generate_locale(dir) if @locale
generate_rakefile(dir)
generate_gemfile(dir)
generate_doc(dir) unless @without_doc
end
end

Expand Down Expand Up @@ -148,4 +150,11 @@ EOS
end
end

def generate_doc(dir)
docdir = dir + '/doc'
FileUtils.mkdir_p docdir
md_files = Dir.glob(@review_dir + '/doc/*.md').map.to_a
FileUtils.cp md_files, docdir
end

main if File.basename($PROGRAM_NAME) == File.basename(__FILE__)

0 comments on commit 8013f09

Please sign in to comment.