Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eas-cli] Fix args
Browse files Browse the repository at this point in the history
radoslawkrzemien committed Dec 1, 2023
1 parent 766d48e commit f24e7e5
Showing 3 changed files with 17 additions and 14 deletions.
12 changes: 6 additions & 6 deletions packages/eas-cli/src/commands/branch/create.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Args } from '@oclif/core';
import chalk from 'chalk';

import { createUpdateBranchOnAppAsync } from '../../branch/queries';
@@ -12,13 +13,12 @@ import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
export default class BranchCreate extends EasCommand {
static override description = 'create a branch';

static override args = [
{
name: 'name',
static override args = {
name: Args.string({
required: false,
description: 'Name of the branch to create',
},
];
}),
};

static override flags = {
...EasNonInteractiveAndJsonFlags,
@@ -49,7 +49,7 @@ export default class BranchCreate extends EasCommand {

const projectDisplayName = await getDisplayNameForProjectIdAsync(graphqlClient, projectId);

if (!name) {
while (!name) {
const validationMessage = 'Branch name may not be empty.';
if (nonInteractive) {
throw new Error(validationMessage);
9 changes: 5 additions & 4 deletions packages/eas-cli/src/commands/branch/delete.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Args } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';

@@ -83,13 +84,13 @@ export default class BranchDelete extends EasCommand {
...this.ContextOptions.LoggedIn,
};

static override args = [
{
static override args = {
name: Args.string({
name: 'name',
required: false,
description: 'Name of the branch to delete',
},
];
}),
};

static override flags = {
...EasNonInteractiveAndJsonFlags,
10 changes: 6 additions & 4 deletions packages/eas-cli/src/commands/branch/view.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Args } from '@oclif/core';

import { selectBranchOnAppAsync } from '../../branch/queries';
import EasCommand from '../../commandUtils/EasCommand';
import { EasNonInteractiveAndJsonFlags } from '../../commandUtils/flags';
@@ -12,13 +14,13 @@ import { enableJsonOutput } from '../../utils/json';
export default class BranchView extends EasCommand {
static override description = 'view a branch';

static override args = [
{
static override args = {
name: Args.string({
name: 'name',
required: false,
description: 'Name of the branch to view',
},
];
}),
};

static override flags = {
...EasPaginatedQueryFlags,

0 comments on commit f24e7e5

Please sign in to comment.