Skip to content

Commit 9a2482a

Browse files
opencode-agent[bot]opencode
authored andcommitted
chore: generate
1 parent 54443bf commit 9a2482a

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

packages/opencode/script/build.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,23 @@ const baselineFlag = process.argv.includes("--baseline")
6565
const skipInstall = process.argv.includes("--skip-install")
6666
const skipEmbedWebUi = process.argv.includes("--skip-embed-web-ui")
6767

68-
69-
const createEmbeddedWebUIBundle = async()=>{
70-
console.log(`Building Web UI to embed in the binary`);
71-
const appDir = path.join(import.meta.dirname, "../../app")
72-
await $`bun run --cwd ${appDir} build`;
73-
const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist")}));
74-
const fileMap = `
68+
const createEmbeddedWebUIBundle = async () => {
69+
console.log(`Building Web UI to embed in the binary`)
70+
const appDir = path.join(import.meta.dirname, "../../app")
71+
await $`bun run --cwd ${appDir} build`
72+
const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist") }))
73+
const fileMap = `
7574
// Import all files as file_$i with type: "file"
7675
${allFiles.map((filePath, i) => `import file_${i} from "${path.join(appDir, "dist", filePath)}" with { type: "file" };`).join("\n")}
7776
// Export with original mappings
7877
export default {
79-
${allFiles.map((filePath, i)=>`"${filePath}": file_${i},`).join("\n")}
78+
${allFiles.map((filePath, i) => `"${filePath}": file_${i},`).join("\n")}
8079
}
8180
`.trim()
82-
return fileMap;
81+
return fileMap
8382
}
8483

85-
const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle();
84+
const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle()
8685

8786
const allTargets: {
8887
os: string

0 commit comments

Comments
 (0)