Skip to content

Configurable path that defaults to the gitignored ./checkout/ directory #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Vagrantfile
.vagrant
checkout/
16 changes: 14 additions & 2 deletions bin/generate_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@
require 'lock_file'
require 'docs_generator'
require 'git_manager'
require 'fileutils'

if ARGV.size > 1 || ARGV.first == "-h" || ARGV.first == "--help"
puts "USAGE: bin/generate_docs.rb [CHECKOUT_PATH]"
exit
end

CHECKOUT_PATH = ARGV.first || Dir.home

unless Dir.exists?(CHECKOUT_PATH)
FileUtils.mkdir(CHECKOUT_PATH)
end

LockFile.acquiring('docs_generation.lock') do
git_manager = GitManager.new(Dir.home)
git_manager = GitManager.new(CHECKOUT_PATH)
git_manager.update_master

generator = DocsGenerator.new(Dir.home, git_manager)
generator = DocsGenerator.new(CHECKOUT_PATH, git_manager)
generator.generate
end