lib/application.rb in docman-0.0.17 vs lib/application.rb in docman-0.0.18
- old
+ new
@@ -43,11 +43,14 @@
@workspace_dir = Dir.pwd
@config = Docman::Config.new(File.join(Pathname(__FILE__).dirname.parent, 'config', 'config.yaml'))
@force = false
end
- def init(name, repo)
- `mkdir #{name} && cd #{name} && git clone --depth 1 #{repo} config`
+ def init(name, repo, options)
+ branch = options['branch'] ? options['branch'] : 'master'
+ `mkdir #{name} && cd #{name} && git clone -b #{branch} --single-branch --depth 1 #{repo} config`
+ #Dir.chdir File.join(name, 'config')
+ #`git checkout #{branch} & git branch -u origin #{branch}`
end
def with_rescue
failed_filepath = File.join(@workspace_dir, 'failed')
if File.file?(failed_filepath)