Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

order of parameters get mixed up #191

Closed
ThomasPinna opened this issue Sep 25, 2019 · 5 comments
Closed

order of parameters get mixed up #191

ThomasPinna opened this issue Sep 25, 2019 · 5 comments

Comments

@ThomasPinna
Copy link

ThomasPinna commented Sep 25, 2019

🐛 Bug Report

With longer meta git commands, the order of parameters might get mixed up, resulting in errors.

To Reproduce

Run a command like

meta git push --set-upstream origin images_in_app

It will for each repository try and run

git push images_in_app --set-upstream origin (resulting in an error)

Expected behavior

It should run the following command in each repository

git push --set-upstream origin images_in_app

Temporary workaround for people with a similar issue

meta git push "--set-upstream origin images_in_app"
--> but this seems a bit annoying imho

@mateodelnorte
Copy link
Owner

Interesting. Any chance you can try and pinpoint where this is happening in code, or perhaps make a PR? This will be in https://github.com/mateodelnorte/meta-git.

@ThomasPinna
Copy link
Author

ThomasPinna commented Sep 26, 2019

I have looked around a little bit and the issue does not seem to be in https://github.com/mateodelnorte/meta-git (it already receives the argv in a scrambled order)

it happens in commander in index.js of this repository. I'm not sure I can tell you how to fix it (you have a fork of commander with some changes, it seems), but if you console.log(program) in the end of the run(cwd, argv) function, you can see the following:

{
 (...)
 rawArgs:
   [ '/usr/local/Cellar/node/12.3.1/bin/node',
     '/Users/thomaspinna/Documents/repositories/meta/bin/meta',
     'git',
     'push',
     '--set-upstream',
     'origin',
     'images_in_app' ],
  args: [ 'git', 'push', 'images_in_app' ],
  runningCommand:
   ChildProcess {
     (...)
     spawnargs:
      [ 'meta-git', 'push', 'images_in_app', '--set-upstream', 'origin' ],
     (...) } }

you might notice that the rawArgs are still correct, but the spawnargs of the childprocess are already wrong.

There is an open issue on commander.js that might be related

@mateodelnorte
Copy link
Owner

mateodelnorte commented Sep 26, 2019 via email

@patrickleet
Copy link
Collaborator

as a workaround, fyi, meta exec "command" might do it for you

@stale
Copy link

stale bot commented Dec 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 31, 2019
@stale stale bot closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants