Skip to content

Commit f8716d6

Browse files
committed
fix: allow build locally and prereleases
1 parent 6444cbd commit f8716d6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cli/bin/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const checkContent = () => {
2727
build({
2828
releases: require('../releases.json'),
2929
loglevel: process.argv.includes('--debug') || process.env.CI ? 'verbose' : 'info',
30-
prerelease: false,
30+
prerelease: true,
3131
useCurrent: checkOnly,
3232
contentPath,
3333
navPath,

cli/lib/gh.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
const {posix, sep} = require('node:path')
2+
const {execSync} = require('node:child_process')
23

34
if (!process.env.GITHUB_TOKEN) {
4-
throw new Error('GITHUB_TOKEN env var is required to build CLI docs')
5+
try {
6+
// this allows people to run this locally
7+
process.env.GITHUB_TOKEN = execSync('gh auth token', {encoding: 'utf8'}).trim()
8+
} catch (err) {
9+
throw new Error('GITHUB_TOKEN env var is required to build CLI docs')
10+
}
511
}
612

713
let octokit

0 commit comments

Comments
 (0)