()
| 146 | } |
| 147 | |
| 148 | async function validateInputParameters() { |
| 149 | // The `--versions` and `--decorate-only` options cannot be used |
| 150 | // with the `--include-deprecated` or `--include-unpublished` options |
| 151 | if ((includeDeprecated || includeUnpublished) && (decorateOnly || versions)) { |
| 152 | const errorMsg = `🛑 You cannot use the versions option with the include-unpublished or include-deprecated options. This is not currently supported in the bundler.\nYou cannot use the decorate-only option with include-unpublished or include-deprecated because the include-unpublished and include-deprecated options are only available when running the bundler. The decorate-only option skips running the bundler.\nPlease reach out to #docs-engineering if a new use case should be supported.` |
| 153 | throw new Error(errorMsg) |
| 154 | } |
| 155 | |
| 156 | // Check that the github/github repo exists. If the files are only being |
| 157 | // decorated, the github/github repo isn't needed. |
| 158 | if (!decorateOnly) { |
| 159 | try { |
| 160 | await stat(GITHUB_REP_DIR) |
| 161 | } catch (error) { |
| 162 | const errorMsg = `🛑 The ${GITHUB_REP_DIR} does not exist. Make sure you have a codespace with a checkout of \`github/github\` at the same level as your \`github/docs-internal \`repo before running this script. See this documentation for details: https://thehub.github.com/epd/engineering/products-and-services/public-apis/rest/openapi/openapi-in-the-docs/#previewing-changes-in-the-docs.` |
| 163 | throw new Error(errorMsg) |
| 164 | } |
| 165 | } |
| 166 | if (versions && versions.length) { |
| 167 | await validateVersionsOptions(versions) |
| 168 | } |
| 169 | } |
no test coverage detected