Skip to content

Commit

Permalink
Tweak site create command for new teams
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Apr 8, 2019
1 parent 3d6f058 commit 513a611
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/commands/sites/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class SitesCreateCommand extends Command {
await this.authenticate()

const accounts = await api.listAccountsForUser()
const personal = accounts.find(account => account.type === 'PERSONAL')

let name = flags.name
if (!name) {
Expand All @@ -39,11 +38,10 @@ class SitesCreateCommand extends Command {
{
type: 'list',
name: 'accountSlug',
message: 'Account:',
default: personal.slug,
message: 'Team:',
choices: accounts.map(account => ({
value: account.slug,
name: `${account.name || account.slug} ${account.slug === personal.slug ? ' (personal)' : ''}`
name: `${account.slug}${account.name ? ' (' + account.name + ')' : ''}`
}))
}
])
Expand All @@ -57,7 +55,7 @@ class SitesCreateCommand extends Command {
}
try {
site = await api.createSiteInTeam({
accountSlug: accountSlug || personal.slug,
accountSlug: accountSlug,
body
})
} catch (error) {
Expand Down

0 comments on commit 513a611

Please sign in to comment.