Skip to content

Commit 4cf0a6c

Browse files
committed
feat: updated homebrew resource to support the new tap trust system
1 parent ec8c26a commit 4cf0a6c

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"license": "ISC",
4242
"type": "module",
4343
"dependencies": {
44-
"@codifycli/plugin-core": "1.2.5-beta.1",
44+
"@codifycli/plugin-core": "^1.2.5-beta.2",
4545
"@codifycli/schemas": "1.2.0",
4646
"ajv": "^8.18.0",
4747
"ajv-formats": "^2.1.1",

src/resources/homebrew/casks-parameter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class CasksParameter extends StatefulParameter<HomebrewConfig, string[]>
100100
for (const cask of casksToInstall) {
101101
const result = await $.spawnSafe(`brew install --casks ${cask}`, {
102102
interactive: true,
103-
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1, HOMEBREW_NO_REQUIRE_TAP_TRUST: 1 }
103+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 }
104104
})
105105

106106
if (result.status === SpawnStatus.SUCCESS) {
@@ -111,7 +111,7 @@ export class CasksParameter extends StatefulParameter<HomebrewConfig, string[]>
111111
if (result.data?.includes('It seems there is already an App at')) {
112112
const adoptResult = await $.spawnSafe(`brew install --casks --adopt ${cask}`, {
113113
interactive: true,
114-
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1, HOMEBREW_NO_REQUIRE_TAP_TRUST: 1 }
114+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 }
115115
})
116116

117117
if (adoptResult.status === SpawnStatus.SUCCESS) {
@@ -133,7 +133,7 @@ export class CasksParameter extends StatefulParameter<HomebrewConfig, string[]>
133133
const $ = getPty();
134134
const result = await $.spawnSafe(`brew uninstall ${casks.join(' ')}`, {
135135
interactive: true,
136-
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1, HOMEBREW_NO_REQUIRE_TAP_TRUST: 1 }
136+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 }
137137
})
138138

139139
if (result.status === SpawnStatus.SUCCESS) {

src/resources/homebrew/formulae-parameter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class FormulaeParameter extends StatefulParameter<HomebrewConfig, string[
6161
const $ = getPty();
6262
const result = await $.spawnSafe(`brew install --formulae ${formulae.join(' ')}`, {
6363
interactive: true,
64-
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1, HOMEBREW_NO_REQUIRE_TAP_TRUST: 1 }
64+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 }
6565
})
6666

6767
if (result.status === SpawnStatus.SUCCESS) {
@@ -79,7 +79,7 @@ export class FormulaeParameter extends StatefulParameter<HomebrewConfig, string[
7979
const $ = getPty();
8080
const result = await $.spawnSafe(`brew uninstall ${formulae.join(' ')}`, {
8181
interactive: true,
82-
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1, HOMEBREW_NO_REQUIRE_TAP_TRUST: 1 }
82+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 }
8383
})
8484

8585
if (result.status === SpawnStatus.SUCCESS) {

src/resources/homebrew/tap-parameter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export class TapsParameter extends StatefulParameter<HomebrewConfig, string[]> {
5151
interactive: true,
5252
env: { HOMEBREW_NO_AUTO_UPDATE: 1, HOMEBREW_NO_ASK: 1, NONINTERACTIVE: 1 },
5353
});
54+
// Homebrew 5.x+ requires taps to be explicitly trusted before their formulae/casks
55+
// can be installed by short name. Auto-trust user-declared taps since they've opted in.
56+
await $.spawnSafe(`brew trust ${tap}`, {
57+
env: { HOMEBREW_NO_AUTO_UPDATE: 1, NONINTERACTIVE: 1 },
58+
});
5459
}
5560
}
5661

0 commit comments

Comments
 (0)