Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Luis's approach to bundled Ruby on Windows instead of gsub.

  • Loading branch information...
commit 570ee54fb84f24406fb07e514aa4c2aec31e7cb4 1 parent a0dace8
@technomancy technomancy authored
View
7 dist/resources/exe/heroku
@@ -1,4 +1,9 @@
-#!HEROKUPATH/ruby-1.9.3/bin/ruby
+#!/bin/sh
+# find embedded ruby relative to script
+bindir=`cd -P "${0%/*}/../ruby-1.9.3/bin" 2>/dev/null; pwd`
+exec "$bindir/ruby" -x "$0" "$@"
+
+#!/usr/bin/env ruby
# attempt to load rubygems
begin
View
20 dist/resources/exe/heroku.bat
@@ -1,13 +1,11 @@
-@echo OFF
+:: Don't use ECHO OFF to avoid possible change of ECHO
+:: Use SETLOCAL so variables set in the script are not persisted
+@SETLOCAL
-:: determine if this is an NT operating system
-if not "%~f0" == "~f0" goto WinNT
-goto Win9x
+:: Add bundled ruby version to the PATH, relative to this script directory.
+@SET HEROKU_RUBY="%~dp0..\ruby-1.9.3\bin"
+@SET PATH=%HEROKU_RUBY%;%PATH%
-:Win9x
-@"HEROKUPATH\ruby-1.9.3\bin\ruby.exe" "HEROKUPATH\heroku" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto :EOF
-
-:WinNT
-@"HEROKUPATH\ruby-1.9.3\bin\ruby.exe" "HEROKUPATH\heroku" %*
-goto :EOF
+:: Invoke 'heroku' (the calling script) as argument to ruby.
+:: Also forward all the arguments provided to it.
+@ruby.exe "%~dpn0" %*
View
4 dist/resources/exe/heroku.iss
@@ -42,10 +42,6 @@ Root: HKCU; Subkey: "Environment"; ValueType: "expandsz"; ValueName: "HOME"; \
ValueData: "%USERPROFILE%"; Flags: createvalueifdoesntexist
[Run]
-Filename: "{app}\ruby-1.9.3\bin\ruby.exe"; Parameters: "-pi -e '$_.gsub! ""HEROKUPATH"", ""{app}""' {app}\bin\heroku.bat"; \
- Flags: runhidden shellexec waituntilterminated; StatusMsg: "Setting isolated Ruby path"; Components: "toolbelt/client"
-Filename: "{app}\ruby-1.9.3\bin\ruby.exe"; Parameters: "-pi -e '$_.gsub! ""HEROKUPATH"", ""{app}""' {app}\bin\heroku"; \
- Flags: runhidden shellexec waituntilterminated; StatusMsg: "Setting isolated Ruby path"; Components: "toolbelt/client"
Filename: "{app}\ruby-1.9.3\bin\gem.bat"; Parameters: "install taps --no-rdoc --no-ri"; \
Flags: runhidden shellexec waituntilterminated; StatusMsg: "Installing Taps"; Components: "toolbelt/client"
Filename: "{app}\ruby-1.9.3\bin\gem.bat"; Parameters: "install foreman --no-rdoc --no-ri"; \
Please sign in to comment.
Something went wrong with that request. Please try again.