Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
Original file line number Diff line number Diff line change
@@ -294,8 +294,13 @@ def subcommand_setup(vm_options, rest)
end

def subcommand_run(vm_options, rest)
jruby_path = Pathname("#{@options[:global][:jruby_truffle_path]}/../..").
relative_path_from(Pathname('.')).to_s
jruby_path = Pathname("#{@options[:global][:jruby_truffle_path]}/../..")

unless jruby_path.absolute?

This comment has been minimized.

Copy link
@eregon

eregon Oct 6, 2015

Member

Should this be a if?

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum Oct 6, 2015

Author Contributor

Nope. If it's absolute, there's no need to make the path relative to anything. Making an absolute path relative from a relative path results in an error.

Did this change break something on you?

This comment has been minimized.

Copy link
@eregon

eregon Oct 6, 2015

Member

No, but then when is it interesting to have a relative path here?

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum Oct 6, 2015

Author Contributor

I assumed you guys were using relative paths because the tool didn't work at all with absolute paths. The examples in the README use relative paths. But I'm never working from the same directory, so it seems of limited value to me.

This comment has been minimized.

Copy link
@eregon

eregon Oct 6, 2015

Member

relative paths in config files always seem better as then the file can be shared (to some extent), but if it's a command line arg then indeed it does not matter much.

jruby_path = jruby_path.relative_path_from(Pathname('.'))
end

jruby_path = jruby_path.to_s

if @options[:run][:build] || @options[:run][:rebuild]
Dir.chdir jruby_path do

0 comments on commit 7a19cab

Please sign in to comment.