Skip to content

Commit

Permalink
refactor(cli): update projects list command to link to manage (#7568)
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 authored Oct 1, 2024
1 parent 7c01a95 commit 85941d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const listProjectsCommand: CliCommandDefinition = {

const projects = await client.projects.list()
const ordered = sortBy(
projects.map(({displayName, id, members = [], studioHost = '', createdAt}) => {
const studio = studioHost ? `https://${studioHost}.sanity.studio` : 'Not deployed'
return [id, members.length, displayName, studio, createdAt].map(String)
projects.map(({displayName, id, members = [], createdAt}) => {
const manage = `https://www.sanity.io/manage/project/${id}`
return [id, members.length, displayName, manage, createdAt].map(String)
}),
[headings.indexOf(flags.sort)],
)
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/test/basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describeCliTest('CLI: basic commands', () => {

testConcurrent('projects list', async () => {
const result = await runSanityCmdCommand(version, ['projects', 'list'])
expect(result.stdout).toContain('.sanity.studio')
expect(result.stdout).toContain('https://www.sanity.io/manage/project/')
expect(result.code).toBe(0)
})

Expand Down

0 comments on commit 85941d2

Please sign in to comment.