Skip to content

Don't prepend ./ to bundle exec argument? #8930

@ioquatix

Description

@ioquatix

https://github.com/rubygems/rubygems/blob/9934845c47225987e5afa78cec383473a8046d31/bundler/lib/bundler/cli/exec.rb#L25

With these two executable files:

> cat script.rb 
#!/usr/bin/env ./runner

puts "Hello World"

> cat runner 
#!/usr/bin/env ruby

puts ARGV.inspect

Executing bundle exec ...:

> bundle exec script.rb
["./script.rb"]
> bundle exec ./script.rb
["././script.rb"]

The former looks incorrect, e.g. bare:

> script.rb
fish: Unknown command: script.rb

it fails because it's missing ./.

And with ./, it gets an EXTRA ./ prepended, making the path unexpectedly ugly.

Of course, bundle exec is free to interpret the arguments how it sees fit, but double appending ./ is the worst possible outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions