From 78b7975f08b975e6080c5224bb745bd8be97beba Mon Sep 17 00:00:00 2001 From: Ian <52504170+ibacher@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:21:32 -0500 Subject: [PATCH] (fix) O3-3370: Also fix handling when not specifying a backend (#1262) --- packages/tooling/openmrs/src/cli.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/tooling/openmrs/src/cli.ts b/packages/tooling/openmrs/src/cli.ts index 0038682c0..931cb2e36 100644 --- a/packages/tooling/openmrs/src/cli.ts +++ b/packages/tooling/openmrs/src/cli.ts @@ -40,9 +40,10 @@ yargs.command( type: 'string', }) .option('backend', { - default: 'https://dev3.openmrs.org/', + default: 'https://dev3.openmrs.org', describe: 'The backend to proxy API requests to.', type: 'string', + coerce: (arg) => (arg.endsWith('/') ? arg.slice(0, -1) : arg), }) .option('add-cookie', { default: '', @@ -132,9 +133,10 @@ yargs.command( type: 'string', }) .option('backend', { - default: 'https://dev3.openmrs.org/', + default: 'https://dev3.openmrs.org', describe: 'The backend to proxy API requests to.', type: 'string', + coerce: (arg) => (arg.endsWith('/') ? arg.slice(0, -1) : arg), }) .option('add-cookie', { default: '',