Skip to content

Commit

Permalink
fix: allow build locally and prereleases
Browse files Browse the repository at this point in the history
  • Loading branch information
reggi committed Dec 5, 2024
1 parent 6444cbd commit f8716d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const checkContent = () => {
build({
releases: require('../releases.json'),
loglevel: process.argv.includes('--debug') || process.env.CI ? 'verbose' : 'info',
prerelease: false,
prerelease: true,
useCurrent: checkOnly,
contentPath,
navPath,
Expand Down
8 changes: 7 additions & 1 deletion cli/lib/gh.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const {posix, sep} = require('node:path')
const {execSync} = require('node:child_process')

if (!process.env.GITHUB_TOKEN) {
throw new Error('GITHUB_TOKEN env var is required to build CLI docs')
try {
// this allows people to run this locally
process.env.GITHUB_TOKEN = execSync('gh auth token', {encoding: 'utf8'}).trim()
} catch (err) {
throw new Error('GITHUB_TOKEN env var is required to build CLI docs')
}
}

let octokit
Expand Down

0 comments on commit f8716d6

Please sign in to comment.