Skip to content

Commit a3a357d

Browse files
committed
fix: add patch command to public commands set
The patch command was registered and unhidden but missing from the hardcoded public commands validation set, causing a spurious "Received an unknown command: patch" error on every CLI invocation. Also removes the workaround in test utils that stripped this error.
1 parent 8d607ca commit a3a357d

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/commands/cli.test.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('socket root command', async () => {
4949
manifest Generate a dependency manifest for certain ecosystems
5050
npm Wraps npm with Socket security scanning
5151
npx Wraps npx with Socket security scanning
52+
patch Apply, manage, and rollback Socket security patches for vulnerable dependencies
5253
raw-npm Run npm without the Socket wrapper
5354
raw-npx Run npx without the Socket wrapper
5455

src/utils/meow-with-subcommands.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ export async function meowWithSubcommands(
553553
'optimize',
554554
'organization',
555555
'package',
556-
//'patch',
556+
'patch',
557557
// PNPM,
558558
'raw-npm',
559559
'raw-npx',
@@ -612,6 +612,7 @@ export async function meowWithSubcommands(
612612
` manifest ${description(subcommands['manifest'])}`,
613613
` npm ${description(subcommands[NPM])}`,
614614
` npx ${description(subcommands[NPX])}`,
615+
` patch ${description(subcommands['patch'])}`,
615616
` raw-npm ${description(subcommands['raw-npm'])}`,
616617
` raw-npx ${description(subcommands['raw-npx'])}`,
617618
'',

test/utils.mts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ function normalizeBanner(str: string): string {
7878
)
7979
// Replace cwd path with "<redacted>".
8080
.replace(/cwd: [^\n"]+/g, 'cwd: <redacted>')
81-
// Strip "Received an unknown command: patch" error line that appears
82-
// when socket-patch binary is not available in the test build.
83-
// Also consume any leading whitespace on the next line so indentation
84-
// stays consistent when the error line is absent.
85-
.replace(/[^\n]*Received an unknown command: patch[^\n]*\n\s*/g, '')
8681
)
8782
}
8883

0 commit comments

Comments
 (0)