lib/travis/tools/completion.rb in travis-1.6.1.travis.363.4 vs lib/travis/tools/completion.rb in travis-1.6.1

- old
+ new

@@ -17,18 +17,22 @@ def cmp_file File.expand_path('travis.sh', config_path) end def install_completion - mkdir_p(config_path) - cp(Assets['travis.sh'], cmp_file) + update_completion source = "source " << cmp_file RCS.each do |file| next unless File.exist? file and File.writable? file next if File.read(file).include? source File.open(file, "a") { |f| f.puts("", "# added by travis gem", "[ -f #{cmp_file} ] && #{source}") } end + end + + def update_completion + mkdir_p(config_path) + cp(Assets['travis.sh'], cmp_file) end def completion_installed? source = "source " << config_path RCS.each do |file|