GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(script): normalize local build channels (#53461) · jonBoone/opencode@8f0f4be

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/script/src
    • index.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/script/src/index.ts‎

Copy file name to clipboardExpand all lines: packages/script/src/index.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ const CHANNEL = await (async () => {
2727
if (env.OPENCODE_CHANNEL) return env.OPENCODE_CHANNEL
2828
if (env.OPENCODE_BUMP) return "latest"
2929
if (env.OPENCODE_VERSION && !env.OPENCODE_VERSION.startsWith("0.0.0-")) return "latest"
30-
return await $`git branch --show-current`.text().then((x) => x.trim())
30+
const branch = await $`git branch --show-current`.text().then((x) => x.trim())
31+
if (!branch) return "detached"
32+
const channel = branch.replace(/[^a-zA-Z0-9._-]/g, "-")
33+
if (/^[a-zA-Z0-9]/.test(channel)) return channel
34+
return `branch-${channel}`
3135
})()
3236
const IS_PREVIEW = CHANNEL !== "latest"
3337

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.