Skip to content

Commit

Permalink
CB-4964 Allow non-english docs to work with rake version
Browse files Browse the repository at this point in the history
  • Loading branch information
agrieve committed Oct 2, 2013
1 parent d8c45ad commit acbf84c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ Generated a Version Release

There is a Rake task to increment the version, generate the version directory, and update the edge documentation.

# generate version 1.7.0
rake version[1.7.0]
# generate version 1.7.0 for english.
rake version[1.7.0,en]

If while running rake you get the error

Expand Down
9 changes: 5 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@ end
task :spec

desc "Increment the version - generates a release and updates the edge documentation"
task :version, :nextVersion do |t, args|
task :version, :nextVersion, :lang do |t, args|
# get current and next version
nextVersion = args[:nextVersion].strip
lang = args[:lang].strip
prevVersion = File.read('VERSION').sub(/rc\d+$/, '').strip # remove release candidate

# generate a release
edge_dir = File.join('docs', 'en', 'edge')
release_dir = File.join('docs', 'en', nextVersion)
edge_dir = File.join('docs', lang, 'edge')
release_dir = File.join('docs', lang, nextVersion)
FileUtils.cp_r(edge_dir, release_dir)

# update version number in new release directory
_nextVersion = nextVersion.sub(/rc\d+$/, '') # cordova file references do not include the RC
unless prevVersion == _nextVersion
files = Dir.glob(File.join('docs', 'en', nextVersion, '**', '*'))
files = Dir.glob(File.join('docs', lang, nextVersion, '**', '*'))

files.sort.each do |file|
next if File.directory?(file) or file !~ /md|html/
Expand Down

0 comments on commit acbf84c

Please sign in to comment.