Skip to content

Commit bd09c0c

Browse files
authored
Show the name of the repo being created/deleted/updated (#503)
1 parent d2aa839 commit bd09c0c

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

src/commands/repos/handle-create-repo.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ export async function handleCreateRepo(
3030
visibility
3131
})
3232

33-
await outputCreateRepo(data, outputKind)
33+
await outputCreateRepo(data, repoName, outputKind)
3434
}

src/commands/repos/handle-delete-repo.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export async function handleDeleteRepo(
1010
) {
1111
const data = await fetchDeleteRepo(orgSlug, repoName)
1212

13-
await outputDeleteRepo(data, outputKind)
13+
await outputDeleteRepo(data, repoName, outputKind)
1414
}

src/commands/repos/handle-update-repo.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ export async function handleUpdateRepo(
3030
visibility
3131
})
3232

33-
await outputUpdateRepo(data, outputKind)
33+
await outputUpdateRepo(data, repoName, outputKind)
3434
}

src/commands/repos/output-create-repo.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { SocketSdkReturnType } from '@socketsecurity/sdk'
88

99
export async function outputCreateRepo(
1010
result: CResult<SocketSdkReturnType<'createOrgRepo'>['data']>,
11+
requestedName: string,
1112
outputKind: OutputKind
1213
): Promise<void> {
1314
if (!result.ok) {
@@ -23,5 +24,7 @@ export async function outputCreateRepo(
2324
return
2425
}
2526

26-
logger.success('Repository created successfully')
27+
logger.success(
28+
`OK. Repository created successfully, slug: \`${result.data.slug}\`${result.data.slug !== requestedName ? ' (Warning: slug is not the same as name that was requested!)' : ''}`
29+
)
2730
}

src/commands/repos/output-delete-repo.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { SocketSdkReturnType } from '@socketsecurity/sdk'
88

99
export async function outputDeleteRepo(
1010
result: CResult<SocketSdkReturnType<'deleteOrgRepo'>['data']>,
11+
repoName: string,
1112
outputKind: OutputKind
1213
): Promise<void> {
1314
if (!result.ok) {
@@ -23,5 +24,5 @@ export async function outputDeleteRepo(
2324
return
2425
}
2526

26-
logger.success('Repository deleted successfully')
27+
logger.success(`OK. Repository \`${repoName}\` deleted successfully`)
2728
}

src/commands/repos/output-update-repo.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { SocketSdkReturnType } from '@socketsecurity/sdk'
88

99
export async function outputUpdateRepo(
1010
result: CResult<SocketSdkReturnType<'updateOrgRepo'>['data']>,
11+
repoName: string,
1112
outputKind: OutputKind
1213
): Promise<void> {
1314
if (!result.ok) {
@@ -23,5 +24,5 @@ export async function outputUpdateRepo(
2324
return
2425
}
2526

26-
logger.success('Repository updated successfully')
27+
logger.success(`Repository \`${repoName}\` updated successfully`)
2728
}

0 commit comments

Comments
 (0)