bin.js 796 B

1234567891011121314151617181920
  1. #!/usr/bin/env node
  2. /**
  3. * Stable link target for the `dsh-pack-vfs-image` bin, forwarding to the build
  4. * product.
  5. *
  6. * pnpm creates a workspace package's bin link only when the link target exists
  7. * at install time. `lib/bin.js` is a build product and is absent on a clean
  8. * checkout, so this committed file is the link target; it forwards to the build
  9. * product when the command runs.
  10. * @module @deepseek-ai/dsh-experimental-webworker-packer/bin
  11. */
  12. import { existsSync } from 'node:fs'
  13. import { fileURLToPath } from 'node:url'
  14. const entry = new URL('./lib/bin.js', import.meta.url)
  15. if (!existsSync(fileURLToPath(entry))) {
  16. process.stderr.write('dsh-pack-vfs-image: lib/bin.js is missing — run `pnpm run build` before packing an image\n')
  17. process.exit(1)
  18. }
  19. await import(entry.href)