Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
uanid committed Jun 14, 2024
1 parent 8f5ecd8 commit 5ae1f71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/cli-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export async function createAction(options: CreateOptions) {
if (response instanceof AxiosError) {
throw response;
}
if (response.status / 100 === 2) {
if (response.status / 100 !== 2) {
console.error(`Failed to create merge request: ${JSON.stringify(response.data)}, Status ${response.status}`);
throw new Error(`Failed to accept merge request`);
process.exit(1);
}
console.log(JSON.stringify(response.data));
}
6 changes: 3 additions & 3 deletions lib/cli-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export async function listAction(options: ListOptions) {
if (response instanceof AxiosError) {
throw response;
}
if (response.status / 100 === 2) {
console.error(`Failed to create merge request: ${JSON.stringify(response.data)}, Status ${response.status}`);
throw new Error(`Failed to accept merge request`);
if (response.status / 100 !== 2) {
console.error(`Failed to list merge requests: ${JSON.stringify(response.data)}, Status ${response.status}`);
process.exit(1);
}
console.log(JSON.stringify(response.data));
}
4 changes: 2 additions & 2 deletions lib/cli-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export async function mergeAction(options: AcceptOptions) {
if (response instanceof AxiosError) {
throw response;
}
if (response.status / 100 === 2) {
if (response.status / 100 !== 2) {
console.error(`Failed to accept merge request: ${JSON.stringify(response.data)}, Status ${response.status}`);
throw new Error(`Failed to accept merge request`);
process.exit(1);
}
console.log(`Merge request ${mergeRequestIid} is accepted`);
}

0 comments on commit 5ae1f71

Please sign in to comment.