Files
gsfdc/demo-dify/dify/e2e/support/web-build.ts
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

31 lines
1.0 KiB
TypeScript

import path from 'node:path'
import { rootDir } from '../scripts/common.ts'
import { startLoggedProcess } from './process.ts'
export const startWebBuildDownload = async (logDir: string) => {
const managedProcess = await startLoggedProcess({
command: process.execPath,
args: ['.github/actions/wait-e2e-web-build/download.cjs'],
cwd: rootDir,
label: 'Web build download',
logFilePath: path.join(logDir, 'cucumber-web-build.log'),
})
// Capture failures immediately, even while the runner is still starting the API.
// Resolving with the error avoids an unhandled rejection before the join point.
const completed = new Promise<Error | undefined>((resolve) => {
managedProcess.childProcess.once('error', resolve)
managedProcess.childProcess.once('close', (code) => {
resolve(
code === 0
? undefined
: new Error(
`Web build download failed (${code ?? 'signal'}). See ${managedProcess.logFilePath}.`,
),
)
})
})
return { process: managedProcess, completed }
}