Skip to content

Commit

Permalink
Merge pull request bibendi#133 from bibendi/fix/run-args
Browse files Browse the repository at this point in the history
fix: escape run args in shell mode
  • Loading branch information
bibendi authored Jul 2, 2021
2 parents 854eed7 + 7d2c352 commit bda3c26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/dip/commands/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ def published_ports

def get_args
if argv.any?
argv
if command[:shell]
[argv.shelljoin]
else
Array(default_args)
end
elsif !(default_args = command[:default_args]).empty?
if command[:shell]
default_args.shellsplit
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/dip/commands/run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

context "when publish is part of a command" do
before { cli.start "run rails s --publish=3000:3000".shellsplit }
it { expected_exec("docker-compose", ["run", "--rm", "app", "rails", "s", "--publish=3000:3000"]) }
it { expected_exec("docker-compose", ["run", "--rm", "app", "rails", "s", "--publish\\=3000:3000"]) }
end

context "when run psql command without db name" do
Expand Down

0 comments on commit bda3c26

Please sign in to comment.