Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/zcli-themes/src/commands/themes/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Import extends Command {
let { flags: { brandId }, argv: [themeDirectory] } = await this.parse(Import)
const themePath = path.resolve(themeDirectory)

brandId = brandId || await getBrandId()
brandId = brandId || await getBrandId('What brand should the theme be imported to?')

const job = await createThemeImportJob(brandId)
const { file, removePackage } = await createThemePackage(themePath)
Expand Down
2 changes: 1 addition & 1 deletion packages/zcli-themes/src/commands/themes/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class List extends Command {
async run () {
let { flags: { brandId } } = await this.parse(List)

brandId = brandId || await getBrandId()
brandId = brandId || await getBrandId('What brand should the themes be listed for?')

try {
CliUx.ux.action.start('Listing themes')
Expand Down
4 changes: 2 additions & 2 deletions packages/zcli-themes/src/lib/getBrandId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Brand } from '../types'
import { request } from '@zendesk/zcli-core'
import * as inquirer from 'inquirer'

export default async function getBrandId (): Promise<string> {
export default async function getBrandId (message?: string): Promise<string> {
try {
const { data: { brands } } = await request.requestAPI('/api/v2/brands.json', {
validateStatus: (status: number) => status === 200
Expand All @@ -16,7 +16,7 @@ export default async function getBrandId (): Promise<string> {
const { brandId } = await inquirer.prompt({
type: 'list',
name: 'brandId',
message: 'What brand should the theme be imported to?',
message: message ?? 'Choose a brand',
choices: brands.map((brand: Brand) => ({
Comment thread
kevinkace marked this conversation as resolved.
name: brand.name,
value: brand.id.toString()
Expand Down
Loading