Skip to content

Commit ca138d3

Browse files
author
abrulic
committed
deployment fix?
1 parent 48c7d6f commit ca138d3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/scripts/generate-docs.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,22 @@ function buildRef(ref: string, labelForOutDir: string) {
9494
try {
9595
const docsWorkspace = docsRelative ? resolve(worktreePath, docsRelative) : worktreePath
9696

97-
if (existsSync(resolve(docsWorkspace, "package.json"))) {
98-
run("pnpm install --frozen-lockfile", { cwd: docsWorkspace, inherit: true })
97+
const rootPkg = existsSync(resolve(worktreePath, "package.json"))
98+
const rootLock = existsSync(resolve(worktreePath, "pnpm-lock.yaml"))
99+
if (rootPkg) {
100+
run(`pnpm install ${rootLock ? "--frozen-lockfile" : "--no-frozen-lockfile"}`, {
101+
cwd: worktreePath,
102+
inherit: true,
103+
})
99104
}
100105

101-
if (existsSync(resolve(worktreePath, "package.json"))) {
102-
run("pnpm install --frozen-lockfile", { cwd: worktreePath, inherit: true })
106+
const docsPkg = existsSync(resolve(docsWorkspace, "package.json"))
107+
const docsLock = existsSync(resolve(docsWorkspace, "pnpm-lock.yaml"))
108+
if (docsPkg && docsLock) {
109+
run("pnpm install --frozen-lockfile", { cwd: docsWorkspace, inherit: true })
103110
}
104111

112+
105113
const outDir = resolve(outputDir, labelForOutDir)
106114
buildDocs(docsWorkspace, outDir)
107115
} finally {

0 commit comments

Comments
 (0)