You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2010/03/14 23:49:42 UTC
svn commit: r922990 - in /buildr/trunk: CHANGELOG lib/buildr/core/util.rb
Author: boisvert
Date: Sun Mar 14 22:49:41 2010
New Revision: 922990
URL: http://svn.apache.org/viewvc?rev=922990&view=rev
Log:
BUILDR-398 FileUtils#sh does not work correctly on Windows
(Pepijn Van Eeckhoudt)
Modified:
buildr/trunk/CHANGELOG
buildr/trunk/lib/buildr/core/util.rb
Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=922990&r1=922989&r2=922990&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sun Mar 14 22:49:41 2010
@@ -88,6 +88,8 @@
task properties (Antoine Toulme, Peter Dettman)
* Fixed: BUILDR-306 Cobertura extension does not handle dependencies
correctly (Pepijn Van Eeckhoudt)
+* Fixed: BUILDR-398 FileUtils#sh does not work correctly on Windows
+ (Pepijn Van Eeckhoudt)
* Fixed: buildr test=all didn't run all tests as expected
* Fixed: Fail-fast if package.with() or include() called with nil values
* Fixed: Failures not reported correctly for ScalaTest (Alex Eagle)
Modified: buildr/trunk/lib/buildr/core/util.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/util.rb?rev=922990&r1=922989&r2=922990&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/util.rb (original)
+++ buildr/trunk/lib/buildr/core/util.rb Sun Mar 14 22:49:41 2010
@@ -434,7 +434,14 @@ if Buildr::Util.java_platform?
rake_check_options options, :noop, :verbose
rake_output_message cmd.join(" ") if options[:verbose]
unless options[:noop]
- cd = "cd '#{Dir.pwd}' && "
+ if Buildr::Util.win_os?
+ # Ruby uses forward slashes regardless of platform,
+ # unfortunately cd c:/some/path fails on Windows
+ pwd = Dir.pwd.gsub(%r{/}, '\\')
+ cd = "cd /d \"#{pwd}\" && "
+ else
+ cd = "cd '#{Dir.pwd}' && "
+ end
args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
res = if Buildr::Util.win_os? && cmd.size == 1