From 8dc0b05c3ed3e3e7e59caa83e2a2fa3e0deb12dd Mon Sep 17 00:00:00 2001 From: MinUk Song Date: Fri, 14 Jun 2024 14:03:45 -0700 Subject: [PATCH] fix: update cli success condition --- lib/cli-create.ts | 2 +- lib/cli-list.ts | 2 +- lib/cli-merge.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cli-create.ts b/lib/cli-create.ts index a102f83..7e2ca38 100644 --- a/lib/cli-create.ts +++ b/lib/cli-create.ts @@ -36,7 +36,7 @@ export async function createAction(options: CreateOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status / 100 !== 2) { + if (Math.floor(response.status / 100) !== 2) { console.error(`Failed to create merge request: ${JSON.stringify(response.data)}, Status ${response.status}`); process.exit(1); } diff --git a/lib/cli-list.ts b/lib/cli-list.ts index f7eb14c..9d43aab 100644 --- a/lib/cli-list.ts +++ b/lib/cli-list.ts @@ -32,7 +32,7 @@ export async function listAction(options: ListOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status / 100 !== 2) { + if (Math.floor(response.status / 100) !== 2) { console.error(`Failed to list merge requests: ${JSON.stringify(response.data)}, Status ${response.status}`); process.exit(1); } diff --git a/lib/cli-merge.ts b/lib/cli-merge.ts index 5e5a0de..7f94d0f 100644 --- a/lib/cli-merge.ts +++ b/lib/cli-merge.ts @@ -33,7 +33,7 @@ export async function mergeAction(options: AcceptOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status / 100 !== 2) { + if (Math.floor(response.status / 100) !== 2) { console.error(`Failed to accept merge request: ${JSON.stringify(response.data)}, Status ${response.status}`); process.exit(1); }