You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Check that the github/github repo exists. If the files are only being
41
+
// decorated, the github/github repo isn't needed.
42
+
if(!decorateOnly){
43
+
try{
44
+
awaitstat(githubRepoDir)
45
+
}catch(error){
46
+
console.log(
47
+
`🛑 The ${githubRepoDir} does not exist. Make sure you have a local, bootstrapped checkout of github/github at the same level as your github/docs-internal repo before running this script.`
48
+
)
49
+
process.exit(1)
50
+
}
51
+
}
52
+
53
+
// When the input parameter type is decorate-only, use the local
54
+
// `github/docs-internal` repo to generate a list of schema files.
55
+
// Otherwise, use the `github/github` list of config files
// Get the list of schemas for this bundle, depending on options
65
+
constschemas=awaitgetSchemas(allSchemas)
32
66
33
67
main()
34
68
35
69
asyncfunctionmain(){
36
70
// Generate the dereferenced OpenAPI schema files
37
71
if(!decorateOnly){
38
-
if(!fs.existsSync(githubRepoDir)){
39
-
console.log(
40
-
`🛑 The ${githubRepoDir} does not exist. Make sure you have a local, bootstrapped checkout of github/github at the same level as your github/docs-internal repo before running this script.`
41
-
)
42
-
process.exit(1)
43
-
}
44
-
45
72
awaitgetDereferencedFiles()
46
73
}
47
-
74
+
// Decorate the dereferenced files in a format ingestible by docs.github.com
48
75
awaitdecorate()
49
76
50
77
console.log(
@@ -64,16 +91,17 @@ async function getDereferencedFiles() {
64
91
execSync('git pull',{cwd: githubRepoDir})
65
92
}
66
93
67
-
// create a tmp directory to store schema files generated from github/github
94
+
// Create a tmp directory to store schema files generated from github/github
68
95
rimraf.sync(tempDocsDir)
69
96
awaitmkdirp(tempDocsDir)
70
97
71
98
console.log(
72
99
`\n🏃♀️🏃🏃♀️Running \`bin/openapi bundle\` in branch '${githubBranch}' of your github/github checkout to generate the dereferenced OpenAPI schema files.\n`
`🛑 You cannot use the versions and decorate-only options with any other options.\nThe decorate-only switch will decorate all dereferenced schemas files in the docs-internal repo.\nThis script doesn't support generating individual deprecated or unpublished schemas.\nPlease reach out to #docs-engineering if this is a use case that you need.`
`🛑 This script doesn't support generating individual deprecated or unpublished schemas. Please reach out to #docs-engineering if this is a use case that you need.`
0 commit comments