Download apps/vis/scripts/copy-web-dist.mjs from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 883 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/scripts/copy-web-dist.mjs
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vis/scripts/copy-web-dist.mjs
-
curl -L -o copy-web-dist.mjs https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/scripts/copy-web-dist.mjs
883 Bytes
| // Copy web/dist/** into server/dist/public/ so the bundled server can serve | |
| // the SPA out of a single deploy artifact. | |
| import { cp, mkdir, rm, stat } from 'node:fs/promises'; | |
| import { dirname, join } from 'node:path'; | |
| import { fileURLToPath } from 'node:url'; | |
| const here = dirname(fileURLToPath(import.meta.url)); | |
| const root = join(here, '..'); | |
| const src = join(root, 'web', 'dist'); | |
| const dst = join(root, 'server', 'dist', 'public'); | |
| try { | |
| await stat(src); | |
| } catch { | |
| process.stderr.write(`[copy-web-dist] source missing: ${src}\n`); | |
| process.stderr.write('Did you run `pnpm --filter @moonshot-ai/vis-web build` first?\n'); | |
| process.exit(1); | |
| } | |
| await rm(dst, { recursive: true, force: true }); | |
| await mkdir(dirname(dst), { recursive: true }); | |
| await cp(src, dst, { recursive: true }); | |
| process.stdout.write(`[copy-web-dist] copied ${src} -> ${dst}\n`); | |