copy-metainfo.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { resolveChannel } from "./utils"
  2. const arg = process.argv[2]
  3. const channel = arg === "dev" || arg === "beta" || arg === "prod" ? arg : resolveChannel()
  4. const appId = channel === "prod" ? "ai.opencode.desktop" : `ai.opencode.desktop.${channel}`
  5. const productName = channel === "prod" ? "OpenCode" : `OpenCode ${channel.charAt(0).toUpperCase() + channel.slice(1)}`
  6. const summary = `Open source AI coding agent${channel !== "prod" ? ` (${channel})` : ""}`
  7. const xml = `<?xml version="1.0" encoding="UTF-8"?>
  8. <component type="desktop-application">
  9. <id>${appId}</id>
  10. <metadata_license>CC0-1.0</metadata_license>
  11. <project_license>MIT</project_license>
  12. <name>${productName}</name>
  13. <summary>${summary}</summary>
  14. <developer id="ly.anoma">
  15. <name>Anomaly Innovations Inc.</name>
  16. </developer>
  17. <description>
  18. <p>
  19. OpenCode is an open source agent that helps you write and run code with any AI model.
  20. </p>
  21. </description>
  22. <launchable type="desktop-id">${appId}.desktop</launchable>
  23. <content_rating type="oars-1.1" />
  24. <url type="bugtracker">https://github.com/anomalyco/opencode/issues</url>
  25. <url type="homepage">https://opencode.ai</url>
  26. <url type="vcs-browser">https://github.com/anomalyco/opencode</url>
  27. <screenshots>
  28. <screenshot type="default">
  29. <image>https://raw.githubusercontent.com/anomalyco/opencode/b75d4d1c5ec449585d515c756fc81f080a157a9a/packages/web/src/assets/lander/screenshot.png</image>
  30. </screenshot>
  31. </screenshots>
  32. </component>
  33. `
  34. await Bun.write(`resources/${appId}.metainfo.xml`, xml)
  35. console.log(`Generated metainfo for ${channel} at resources/${appId}.metainfo.xml`)