Skip to content

Commit

Permalink
refactor(update): rename branchIsCreated to createdBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Nov 23, 2022
1 parent 56871ac commit 4c7886c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/eas-cli/src/branch/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@ export async function ensureBranchExistsAsync(
appId: string;
branchName: string;
}
): Promise<{ branchId: string; branchIsCreated: boolean }> {
): Promise<{ branchId: string; createdBranch: boolean }> {
try {
const updateBranch = await BranchQuery.getBranchByNameAsync(graphqlClient, {
appId,
name: branchName,
});

const { id } = updateBranch;
return { branchId: id, branchIsCreated: false };
return { branchId: id, createdBranch: false };
} catch (error) {
if (error instanceof BranchNotFoundError) {
const newUpdateBranch = await createUpdateBranchOnAppAsync(graphqlClient, {
appId,
name: branchName,
});
return { branchId: newUpdateBranch.id, branchIsCreated: true };
return { branchId: newUpdateBranch.id, createdBranch: true };
} else {
throw error;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/eas-cli/src/commands/update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@ export default class UpdatePublish extends EasCommand {
.map(pair => pair[0]);
}

const { branchId, branchIsCreated } = await ensureBranchExistsAsync(graphqlClient, {
const { branchId, createdBranch } = await ensureBranchExistsAsync(graphqlClient, {
appId: projectId,
branchName,
});
if (branchIsCreated) {
if (createdBranch) {
await ensureChannelExistsAsync(graphqlClient, {
appId: projectId,
branchId,
Expand Down

0 comments on commit 4c7886c

Please sign in to comment.