lib/warp/dir/command/install.rb in warp-dir-1.3.0 vs lib/warp/dir/command/install.rb in warp-dir-1.5.0

- old
+ new

@@ -17,11 +17,11 @@ ::Warp::Dir::DOTFILES.any?{ |file| already_installed?(file) } end def already_installed?(file_path) path = ::Warp::Dir.absolute(file_path) - matches = if File.exists?(path) + matches = if File.exist?(path) File.open path do |file| file.find { |line| line =~ ::Warp::Dir::SHELL_WRAPPER_REGX } end end matches @@ -82,10 +82,10 @@ def append_wrapper_to(shell_init_file) file = ::Warp::Dir.absolute(shell_init_file) pre_installed = self.class.already_installed?(file) self.existing << file if pre_installed - if File.exists?(file) + if File.exist?(file) if !pre_installed || config[:force] source = File.read(file) source.gsub!(/# WarpDir.*BEGIN\n.*\n# WarpDir.*END/, '') File.open(file, 'w') do |f| f.write source