jpg619/fix-accessibility-content-flow
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | const {resolve, relative, join} = require('path') |
| 2 | const {spawnSync} = require('child_process') |
| 3 | const build = require('../lib/build.js') |
| 4 | const {nwo} = require('../lib/gh') |
| 5 | const {CacheVersionSha} = require('../lib/cache.js') |
| 6 | |
| 7 | // check only build with the current versions instead of checking the registry |
| 8 | // and also fails if any changes are detected. this is used in CI to make sure |
| 9 | // edits to the CLI content are made in the CLI repo |
| 10 | const checkOnly = process.argv.includes('--check-only') |
| 11 | |
| 12 | const ROOT = resolve(__dirname, '../..') |
| 13 | const contentPath = join(ROOT, 'content/cli') |
| 14 | const navPath = join(ROOT, 'content/nav.yml') |
| 15 | |
| 16 | const checkContent = () => { |
| 17 | const status = spawnSync('git', ['status', '--porcelain', contentPath], {encoding: 'utf-8'}) |
| 18 | if (status.stdout) { |
| 19 | const msg = [ |
| 20 | `The following untracked changes to ${relative(process.cwd(), contentPath)} were found:`, |
| 21 | status.stdout, |
| 22 | `These files are generated and changes might need to be made in the ${nwo} repository.`, |
| 23 | ] |
| 24 | throw new Error(msg.join('\n')) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | ;(async () => { |
| 29 | try { |
| 30 | await build({ |
| 31 | cache: await CacheVersionSha.load(join(ROOT, 'cli-cache.json')), |
| 32 | releases: require('../releases.json'), |
| 33 | loglevel: process.argv.includes('--debug') || process.env.CI ? 'verbose' : 'info', |
| 34 | prerelease: false, |
| 35 | useCurrent: checkOnly, |
| 36 | contentPath, |
| 37 | navPath, |
| 38 | }) |
| 39 | if (checkOnly) { |
| 40 | checkContent() |
| 41 | } |
| 42 | return console.log('DONE') |
| 43 | } catch (e) { |
| 44 | console.error(e) |
| 45 | process.exit(1) |
| 46 | } |
| 47 | })() |