diff options
Diffstat (limited to 'instruby.rb')
-rw-r--r-- | instruby.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/instruby.rb b/instruby.rb index 3eb8fcea72..a9d66c7670 100644 --- a/instruby.rb +++ b/instruby.rb @@ -72,6 +72,7 @@ def makedirs(dirs) end def with_destdir(dir) + return dir if $destdir.empty? dir = dir.sub(/\A\w:/, '') if File::PATH_SEPARATOR == ';' $destdir + dir end @@ -155,11 +156,11 @@ for src in Dir["bin/*"] open(with_destdir(batfile), "w") { |b| b.print <<EOH, shebang, body, <<EOF @echo off -if "%OS%" == "Windows_NT" goto WinNT +if not "%~d0" == "~d0" goto WinNT #{ruby_bin_dosish} -x "#{batfile}" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofruby :WinNT -#{ruby_bin_dosish} -x "#{batfile}" %* +"%~dp0#{ruby_install_name}" -x "%~f0" %* goto endofruby EOH __END__ |