Skip to content

Commit 4f0f508

Browse files
pvdzjdalton
andauthored
Set exit code for report commands (#419)
Co-authored-by: John-David Dalton <jdalton@users.noreply.github.com>
1 parent 1be54c8 commit 4f0f508

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/commands/report/cmd-report-create.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('socket report create', async () => {
5555
\\x1b[31m\\xd7\\x1b[39m This command has been sunset. Instead, please look at \`socket scan create\` to create scans and \`socket scan report\` to view a report of your scans."
5656
`)
5757

58-
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
58+
expect(code).toBe(1)
5959
}
6060
)
6161
})

src/commands/report/cmd-report-create.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ async function run(
5252
logger.fail(
5353
'This command has been sunset. Instead, please look at `socket scan create` to create scans and `socket scan report` to view a report of your scans.'
5454
)
55+
56+
process.exitCode = 1
5557
}

src/commands/report/cmd-report-view.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('socket report create', async () => {
5555
\\x1b[31m\\xd7\\x1b[39m This command has been sunset. Instead, please look at \`socket scan create\` to create scans and \`socket scan report\` to view a report of your scans."
5656
`)
5757

58-
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
58+
expect(code).toBe(1)
5959
}
6060
)
6161
})

src/commands/report/cmd-report-view.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ async function run(
4141
logger.fail(
4242
'This command has been sunset. Instead, please look at `socket scan create` to create scans and `socket scan report` to view a report of your scans.'
4343
)
44+
45+
process.exitCode = 1
4446
}

0 commit comments

Comments
 (0)