@@ -148,6 +148,16 @@ export namespace Installation {
|
|||||||
break
|
break
|
||||||
case "brew": {
|
case "brew": {
|
||||||
const formula = await getBrewFormula()
|
const formula = await getBrewFormula()
|
||||||
|
if (formula.includes("/")) {
|
||||||
|
cmd =
|
||||||
|
$`brew tap anomalyco/tap && cd "$(brew --repo anomalyco/tap)" && git pull --ff-only && brew upgrade ${formula}`.env(
|
||||||
|
{
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE: "1",
|
||||||
|
...process.env,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
break
|
||||||
|
}
|
||||||
cmd = $`brew upgrade ${formula}`.env({
|
cmd = $`brew upgrade ${formula}`.env({
|
||||||
HOMEBREW_NO_AUTO_UPDATE: "1",
|
HOMEBREW_NO_AUTO_UPDATE: "1",
|
||||||
...process.env,
|
...process.env,
|
||||||
@@ -188,14 +198,19 @@ export namespace Installation {
|
|||||||
|
|
||||||
if (detectedMethod === "brew") {
|
if (detectedMethod === "brew") {
|
||||||
const formula = await getBrewFormula()
|
const formula = await getBrewFormula()
|
||||||
if (formula === "opencode") {
|
if (formula.includes("/")) {
|
||||||
return fetch("https://formulae.brew.sh/api/formula/opencode.json")
|
const infoJson = await $`brew info --json=v2 ${formula}`.quiet().text()
|
||||||
.then((res) => {
|
const info = JSON.parse(infoJson)
|
||||||
if (!res.ok) throw new Error(res.statusText)
|
const version = info.formulae?.[0]?.versions?.stable
|
||||||
return res.json()
|
if (!version) throw new Error(`Could not detect version for tap formula: ${formula}`)
|
||||||
})
|
return version
|
||||||
.then((data: any) => data.versions.stable)
|
|
||||||
}
|
}
|
||||||
|
return fetch("https://formulae.brew.sh/api/formula/opencode.json")
|
||||||
|
.then((res) => {
|
||||||
|
if (!res.ok) throw new Error(res.statusText)
|
||||||
|
return res.json()
|
||||||
|
})
|
||||||
|
.then((data: any) => data.versions.stable)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detectedMethod === "npm" || detectedMethod === "bun" || detectedMethod === "pnpm") {
|
if (detectedMethod === "npm" || detectedMethod === "bun" || detectedMethod === "pnpm") {
|
||||||
|
|||||||
Reference in New Issue
Block a user