66# users; since Enterprise is a "managed" product, it's cut off of DotCom at a certain
77# time, and the APIs remain frozen (until an organization upgrades their instance).
88#
9- # This script takes two arguments: a date and a version number. Given a date , it
9+ # This script takes two arguments: a SHA and a version number. Given a sha , it
1010# fetches the state of the site at that moment in time. It then copies all of that
1111# content into a new folder called *enterprise/<version>*. Thus, we're able to preserve
1212# the state of the API documentation for a given version at a given time.
@@ -15,13 +15,13 @@ require 'fileutils'
1515require 'tmpdir'
1616
1717if ARGV . length != 2
18- error = '' 'Error: Run the script like this: bundle exec script/enterprise-cutter [DATE ] [VERSION]
19- e.g. bundle exec script/enterprise-cutter 2014-07-08 11.10.340
18+ error = '' 'Error: Run the script like this: bundle exec script/enterprise-cutter [SHA ] [VERSION]
19+ e.g. bundle exec script/enterprise-cutter deadb33f 11.10.340
2020' ''
2121 abort error
2222end
2323
24- DATE = ARGV [ 0 ] . dup # yyyy-mm-dd , like, 2014-07-08
24+ SHA = ARGV [ 0 ] . dup # SHA , like, deadb33f
2525VERSION = ARGV [ 1 ] . dup # like, 11.10.340
2626
2727BRANCH_NAME = "add-#{ VERSION } -docs"
3232
3333temp_dir = Dir . mktmpdir
3434begin
35- %x(git checkout `git rev-list -n 1 --before=" #{ DATE } " gh-pages` )
35+ %x(git checkout #{ SHA } )
3636 `cp -r * #{ temp_dir } `
3737 `git checkout #{ BRANCH_NAME } `
3838 FileUtils . mkdir_p ( "enterprise/#{ VERSION } " )
0 commit comments