FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
developer.github.com/script/enterprise-cutter at master · JavaLeaks/developer.github.com · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JavaLeaks
/
developer.github.com
Public
forked from
github/developer.github.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
developer.github.com
/
script
/
enterprise-cutter
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
51 lines (40 loc) · 1.75 KB
Breadcrumbs
developer.github.com
/
script
/
enterprise-cutter
Copy path
File metadata and controls
executable file
·
51 lines (40 loc) · 1.75 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env ruby
# When releasing a new Enterprise version, the set of GitHub APIs available to that
# verison do not match the set of documentation generally available on developer.github.com.
# That's because the content on developer.github.com represents everything available to DotCom
# users; since Enterprise is a "managed" product, it's cut off of DotCom at a certain
# time, and the APIs remain frozen (until an organization upgrades their instance).
#
# This script takes two arguments: a date and a version number. Given a date, it
# fetches the state of the site at that moment in time. It then copies all of that
# content into a new folder called *enterprise/<version>*. Thus, we're able to preserve
# the state of the API documentation for a given version at a given time.
require
'fileutils'
require
'tmpdir'
if
ARGV
.
length
!=
2
error
=
''
'Error: Run the script like this: bundle exec script/enterprise-cutter [DATE] [VERSION]
e.g. bundle exec script/enterprise-cutter 2014-07-08 11.10.340
'
''
abort
error
end
DATE
=
ARGV
[
0
]
.
dup
# yyyy-mm-dd, like, 2014-07-08
VERSION
=
ARGV
[
1
]
.
dup
# like, 11.10.340
BRANCH_NAME
=
"add-
#{
VERSION
}
-docs"
Dir
.
glob
(
'tasks/*.rake'
)
.
each
{
|
r
|
load
r
}
setup
temp_dir
=
Dir
.
mktmpdir
begin
%x(git checkout `git rev-list -n 1 --before="
#{
DATE
}
" gh-pages`)
`cp -r *
#{
temp_dir
}
`
`git checkout
#{
BRANCH_NAME
}
`
FileUtils
.
mkdir_p
(
"enterprise/
#{
VERSION
}
"
)
`cp -r
#{
temp_dir
}
/* enterprise/
#{
VERSION
}
`
rewrite_content
(
"enterprise/
#{
VERSION
}
"
)
`rm -rf enterprise/
#{
VERSION
}
/enterprise`
`rm -rf enterprise/
#{
VERSION
}
/output`
`git add enterprise`
`git commit -m "Added enterprise-
#{
VERSION
}
files"`
ensure
FileUtils
.
remove_entry_secure
temp_dir
end
puts
"
\n
\n
Okay! Feel free to `git push
#{
BRANCH_NAME
}
` if you like."
Back
|
FazBrowse Home
|
New Git URL