Skip to content
This repository

Print warning when rakefile appears to be broken #57

wants to merge 1 commit into from

2 participants

pivotalvfiles Richard Schneeman

Related to #34, but a little simpler and naive.

It will print a warning if the dry-run fails, but the error doesn't incude the Don't know how to build task '...' message. Otherwise the behavior is as you would expect.

Richard Schneeman

we had some major errors merging in #34 :( this won't cleanly merge anymore. This won't be merged in.

Richard Schneeman schneems closed this

Showing 1 unique commit by 1 author.

Dec 31, 2012
Print a warning when rake file doesn't seem to load correctly b93a49f

Showing 1 changed file with 7 additions and 1 deletion. Show Diff Stats Hide Diff Stats

  1. 8  lib/language_pack/ruby.rb
8  lib/language_pack/ruby.rb
@@ -546,7 +546,13 @@ def lockfile_parser
546 546
   # @param [String] the task in question
547 547
   # @return [Boolean] true if the rake task is defined in the app
548 548
   def rake_task_defined?(task)
-    run("env PATH=$PATH bundle exec rake #{task} --dry-run") && $?.success?
+    output = run("env PATH=$PATH bundle exec rake #{task} --dry-run")
+    if output && $?.success?
+      return true
+    elsif !output.match(/Don't know how to build task '#{task}'/)
+      puts "WARNING: There appears to have been an issue loading your rake file, you might like to check it out"
+    end
+    false
550 556
551 557
552 558
   # executes the block with GIT_DIR environment variable removed since it can mess with the current working directory git thinks it's in


Something went wrong with that request. Please try again.