lib/commandly/generator.rb in commandly-0.1.1 vs lib/commandly/generator.rb in commandly-0.1.2
- old
+ new
@@ -13,11 +13,12 @@
directory "ios", "ios"
end
def find_replace_ios_text
project_name = File.basename(destination_root)
- Dir.glob(destination_root + "/ios/**/**").each do |name|
+ files = Dir.glob(destination_root + "/ios/**/**")
+ files.each do |name|
next if Dir.exists? name
text = File.read(name)
text = text.gsub("Commandly", project_name)
File.open(name, "w") { |file| file.puts text }
end
@@ -45,10 +46,12 @@
directory "android", "android"
end
def find_replace_android_text
project_name = File.basename(destination_root)
- Dir.glob(destination_root + "/android/**/**").each do |name|
+ files = Dir.glob(destination_root + "/android/**/**")
+ files -= Dir.glob(destination_root + "/gradle/wrapper/gradle-wrapper.jar")
+ files.each do |name|
next if Dir.exists? name
text = File.read(name)
text = text.gsub("Commandly", project_name)
text = text.gsub("commandly", project_name.downcase)
File.open(name, "w") { |file| file.puts text }