From 5b837bfb21d21ff2b2fe2b5fea945a1574070a13 Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Thu, 29 Aug 2024 15:47:56 -0700 Subject: [PATCH] Fix(run): arguments are incorrectly gathered leading to duplicates --- packages/cli/src/commands/run/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/run/index.ts b/packages/cli/src/commands/run/index.ts index 87a1b3e11e..fe21994886 100644 --- a/packages/cli/src/commands/run/index.ts +++ b/packages/cli/src/commands/run/index.ts @@ -4,7 +4,7 @@ import {ux} from '@oclif/core' import debugFactory from 'debug' import * as Heroku from '@heroku-cli/schema' import Dyno from '../../lib/run/dyno' -import {buildCommand, revertSortedArgs} from '../../lib/run/helpers' +import {buildCommand} from '../../lib/run/helpers' const debug = debugFactory('heroku:run') @@ -33,14 +33,14 @@ export default class Run extends Command { async run() { const {argv, flags} = await this.parse(Run) - const userArgvInputOrder = revertSortedArgs(process.argv, argv as string[]) - + const maybeOptionsIndex = process.argv.indexOf(' -- ') + const command = buildCommand((maybeOptionsIndex === -1 ? argv : process.argv.slice(maybeOptionsIndex)) as string[]) const opts = { 'exit-code': flags['exit-code'], 'no-tty': flags['no-tty'], app: flags.app, attach: true, - command: buildCommand(userArgvInputOrder as string[]), + command, env: flags.env, heroku: this.heroku, listen: flags.listen,