Skip to content

Commit cc49b34

Browse files
committed
Add hidden --glob flag to fix
1 parent 546876a commit cc49b34

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/commands/fix/cmd-fix.mts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ const hiddenFlags: MeowFlags = {
105105
...generalFlags['id'],
106106
hidden: true,
107107
} as MeowFlag,
108+
glob: {
109+
type: 'string',
110+
default: '',
111+
description: 'Glob pattern to pass to coana for filtering files',
112+
hidden: true,
113+
},
108114
maxSatisfying: {
109115
type: 'boolean',
110116
default: true,
@@ -190,6 +196,7 @@ async function run(
190196

191197
const {
192198
autopilot,
199+
glob,
193200
json,
194201
limit,
195202
markdown,
@@ -203,6 +210,7 @@ async function run(
203210
unknownFlags = [],
204211
} = cli.flags as {
205212
autopilot: boolean
213+
glob: string
206214
limit: number
207215
json: boolean
208216
markdown: boolean
@@ -273,6 +281,7 @@ async function run(
273281
autopilot,
274282
cwd,
275283
ghsas,
284+
glob,
276285
limit,
277286
minSatisfying,
278287
prCheck,

src/commands/fix/coana-fix.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export async function coanaFix(
4141
autopilot,
4242
cwd,
4343
ghsas,
44+
glob,
4445
limit,
4546
onlyCompute,
4647
orgSlug,
@@ -116,9 +117,10 @@ export async function coanaFix(
116117
...(fixConfig.rangeStyle
117118
? ['--range-style', fixConfig.rangeStyle]
118119
: []),
119-
...fixConfig.unknownFlags,
120+
...(glob ? ['--glob', glob] : []),
120121
...(onlyCompute ? ['--dry-run'] : []),
121122
...(outputFile ? ['--output-file', outputFile] : []),
123+
...fixConfig.unknownFlags,
122124
],
123125
fixConfig.orgSlug,
124126
{ cwd, spinner, stdio: 'inherit' },
@@ -167,6 +169,7 @@ export async function coanaFix(
167169
...(fixConfig.rangeStyle
168170
? ['--range-style', fixConfig.rangeStyle]
169171
: []),
172+
...(glob ? ['--glob', glob] : []),
170173
...fixConfig.unknownFlags,
171174
],
172175
fixConfig.orgSlug,
@@ -223,6 +226,7 @@ export async function coanaFix(
223226
...(fixConfig.rangeStyle
224227
? ['--range-style', fixConfig.rangeStyle]
225228
: []),
229+
...(glob ? ['--glob', glob] : []),
226230
...fixConfig.unknownFlags,
227231
],
228232
fixConfig.orgSlug,

src/commands/fix/handle-fix.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const CVE_FORMAT_REGEXP = /^CVE-\d{4}-\d{4,}$/
1515
export type HandleFixConfig = Remap<
1616
FixConfig & {
1717
ghsas: string[]
18+
glob: string
1819
orgSlug: string
1920
outputKind: OutputKind
2021
unknownFlags: string[]
@@ -91,6 +92,7 @@ export async function handleFix({
9192
autopilot,
9293
cwd,
9394
ghsas,
95+
glob,
9496
limit,
9597
minSatisfying,
9698
onlyCompute,
@@ -108,6 +110,7 @@ export async function handleFix({
108110
cwd,
109111
// Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only
110112
ghsas: await convertIdsToGhsas(ghsas),
113+
glob,
111114
limit,
112115
minSatisfying,
113116
orgSlug,

src/commands/fix/types.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type FixConfig = {
55
autopilot: boolean
66
cwd: string
77
ghsas: string[]
8+
glob: string
89
limit: number
910
minSatisfying: boolean
1011
orgSlug: string

0 commit comments

Comments
 (0)