fix: allow docker builds to skip missing a2ui assets
This commit is contained in:
@@ -24,7 +24,7 @@ COPY scripts ./scripts
|
|||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm build
|
RUN CLAWDBOT_A2UI_SKIP_MISSING=1 pnpm build
|
||||||
# Force pnpm for UI build (Bun may fail on ARM/Synology architectures)
|
# Force pnpm for UI build (Bun may fail on ARM/Synology architectures)
|
||||||
ENV CLAWDBOT_PREFER_PNPM=1
|
ENV CLAWDBOT_PREFER_PNPM=1
|
||||||
RUN pnpm ui:install
|
RUN pnpm ui:install
|
||||||
|
|||||||
@@ -19,12 +19,17 @@ export async function copyA2uiAssets({
|
|||||||
srcDir: string;
|
srcDir: string;
|
||||||
outDir: string;
|
outDir: string;
|
||||||
}) {
|
}) {
|
||||||
|
const skipMissing = process.env.CLAWDBOT_A2UI_SKIP_MISSING === "1";
|
||||||
try {
|
try {
|
||||||
await fs.stat(path.join(srcDir, "index.html"));
|
await fs.stat(path.join(srcDir, "index.html"));
|
||||||
await fs.stat(path.join(srcDir, "a2ui.bundle.js"));
|
await fs.stat(path.join(srcDir, "a2ui.bundle.js"));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message =
|
const message =
|
||||||
'Missing A2UI bundle assets. Run "pnpm canvas:a2ui:bundle" and retry.';
|
'Missing A2UI bundle assets. Run "pnpm canvas:a2ui:bundle" and retry.';
|
||||||
|
if (skipMissing) {
|
||||||
|
console.warn(`${message} Skipping copy (CLAWDBOT_A2UI_SKIP_MISSING=1).`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
throw new Error(message, { cause: err });
|
throw new Error(message, { cause: err });
|
||||||
}
|
}
|
||||||
await fs.mkdir(path.dirname(outDir), { recursive: true });
|
await fs.mkdir(path.dirname(outDir), { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user