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

Since 7.1.2 shell: false commands with any argument fails with "undefined local variable or method `default_args' " #135

Closed
zaratan opened this issue Jul 14, 2021 · 2 comments · Fixed by #136

Comments

@zaratan
Copy link
Contributor

zaratan commented Jul 14, 2021

Describe the bug
Since 7.1.2 (It works with 7.1.1) if a command is declared as shell: false it will fail if given any argument.

Here is the stacktrace:

Traceback (most recent call last):
        9: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/exe/dip:23:in `<main>'
        8: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/lib/dip/cli.rb:31:in `start'
        7: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        6: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        5: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        4: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        3: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/lib/dip/cli.rb:85:in `run'
        2: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/lib/dip/commands/run.rb:30:in `execute'
        1: from /Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/lib/dip/commands/run.rb:59:in `compose_arguments'
/Users/pasind/.rvm/gems/ruby-2.7.4@shotgun/gems/dip-7.1.2/lib/dip/commands/run.rb:84:in `get_args': undefined local variable or method `default_args' for #<Dip::Commands::Run:0x00007f939d82d628> (NameError)

To Reproduce
Steps to reproduce the behavior:

  1. Provide dip.yml config
compose:
  files:
    - ./docker-compose.yml
interaction:
  rvm:
    description: Start rvm in the app container
    service: app_dev
    command: rvm
    shell: false
  1. Provide docker-compose.yml
    Not really relevant. I can provide one if needed.

  2. Run command
    dip rvm install 2.7.4

  3. See error

Expected behavior
Should work.

Screenshots
Capture d’écran 2021-07-14 à 09 45 51
The second dip command is using 7.1.1

Context (please complete the following information):

  • OS: OSX 14
  • Version 7.1.2
@zaratan
Copy link
Contributor Author

zaratan commented Jul 14, 2021

I know what the problem is and how to fix it. I'll open a PR soon. I wanted to have a corresponding issue to document the problem.

@zaratan
Copy link
Contributor Author

zaratan commented Jul 14, 2021

This commit is the culprit: 7d2c352

zaratan added a commit to zaratan/dip that referenced this issue Jul 14, 2021
zaratan added a commit to zaratan/dip that referenced this issue Jul 14, 2021
@zaratan zaratan changed the title Since 7.2.0 shell: false commands with any argument fails with "undefined local variable or method `default_args' " Since 7.1.2 shell: false commands with any argument fails with "undefined local variable or method `default_args' " Jul 14, 2021
bibendi added a commit that referenced this issue Jul 14, 2021
For #135: Fixing shell: false commands with args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant