lib/ruboto/util/setup.rb in ruboto-1.0.2 vs lib/ruboto/util/setup.rb in ruboto-1.0.3
- old
+ new
@@ -643,9 +643,14 @@
(@existing_paths + @missing_paths - %w(/usr/bin)).uniq.sort.each do |path|
f << %Q{PATH="#{path}:$PATH"\n}
end
end
config_file_name = File.expand_path("~/#{a.nil? || a.empty? ? path_setup_file : a}")
+ unless File.exist? config_file_name
+ puts "Your path configuration script (#{config_file_name}) does not exist, Ruboto will create a new one."
+ system "touch #{config_file_name}"
+ end
+
old_config = File.read(config_file_name)
new_config = old_config.dup
new_config.gsub! /\n*# BEGIN Ruboto setup\n.*?\n# END Ruboto setup\n*/m, ''
new_config << "\n\n# BEGIN Ruboto setup\n"
new_config << "source #{rubotorc}\n"