Skip to content
This repository
Browse code

Don't run file merge commands in extension/form generators when

--pretend option is present.

When --pretend option is present no files are being actually created
so when extension/form generator tries to merge locales, seeds etc.
it fails because needed files doesn't exist.
  • Loading branch information...
commit 82995ab7e8c0e5e84457206292cbc0ebb9576f62 1 parent 633f28c
Uģis Ozols authored September 13, 2012
8  core/lib/generators/refinery/engine/engine_generator.rb
@@ -22,11 +22,13 @@ def generate
22 22
 
23 23
       evaluate_templates!
24 24
 
25  
-      merge_locales!
  25
+      unless options[:pretend]
  26
+        merge_locales!
26 27
 
27  
-      copy_or_merge_seeds!
  28
+        copy_or_merge_seeds!
28 29
 
29  
-      append_extension_to_gemfile!
  30
+        append_extension_to_gemfile!
  31
+      end
30 32
 
31 33
       finalize_extension!
32 34
     end
8  core/lib/generators/refinery/form/form_generator.rb
@@ -16,11 +16,13 @@ def generate
16 16
 
17 17
       evaluate_templates!
18 18
 
19  
-      merge_locales!
  19
+      unless options[:pretend]
  20
+        merge_locales!
20 21
 
21  
-      copy_or_merge_seeds!
  22
+        copy_or_merge_seeds!
22 23
 
23  
-      append_extension_to_gemfile!
  24
+        append_extension_to_gemfile!
  25
+      end
24 26
 
25 27
       finalize_extension!
26 28
     end

0 notes on commit 82995ab

Please sign in to comment.
Something went wrong with that request. Please try again.