update File.exists? calls to File.exist?

This commit is contained in:
Jason Barnett
2024-05-21 09:45:50 -06:00
parent 75bbe11ccf
commit d3b03b940a
4 changed files with 13 additions and 13 deletions

View File

@@ -101,7 +101,7 @@ task :install_vundle do
puts ""
vundle_path = File.join('vim','bundle', 'vundle')
unless File.exists?(vundle_path)
unless File.exist?(vundle_path)
run %{
cd $HOME/.yadr
git clone https://github.com/gmarik/vundle.git #{vundle_path}
@@ -197,7 +197,7 @@ def install_term_theme
run %{ /usr/libexec/PlistBuddy -c "Merge 'iTerm2/Solarized Dark.itermcolors' :'Custom Color Presets':'Solarized Dark'" ~/Library/Preferences/com.googlecode.iterm2.plist }
# If iTerm2 is not installed or has never run, we can't autoinstall the profile since the plist is not there
if !File.exists?(File.join(ENV['HOME'], '/Library/Preferences/com.googlecode.iterm2.plist'))
if !File.exist?(File.join(ENV['HOME'], '/Library/Preferences/com.googlecode.iterm2.plist'))
puts "======================================================"
puts "To make sure your profile is using the solarized theme"
puts "Please check your settings under:"
@@ -279,7 +279,7 @@ def install_prezto
puts "Zsh is already configured as your shell of choice. Restart your session to load the new settings"
else
puts "Setting zsh as your default shell"
if File.exists?("/usr/local/bin/zsh")
if File.exist?("/usr/local/bin/zsh")
if File.readlines("/private/etc/shells").grep("/usr/local/bin/zsh").empty?
puts "Adding zsh to standard shell list"
run %{ echo "/usr/local/bin/zsh" | sudo tee -a /private/etc/shells }
@@ -310,7 +310,7 @@ def install_files(files, method = :symlink)
puts "Source: #{source}"
puts "Target: #{target}"
if File.exists?(target) && (!File.symlink?(target) || (File.symlink?(target) && File.readlink(target) != source))
if File.exist?(target) && (!File.symlink?(target) || (File.symlink?(target) && File.readlink(target) != source))
puts "[Overwriting] #{target}...leaving original at #{target}.backup..."
run %{ mv "$HOME/.#{file}" "$HOME/.#{file}.backup" }
end
@@ -327,7 +327,7 @@ def install_files(files, method = :symlink)
end
def needs_migration_to_vundle?
File.exists? File.join('vim', 'bundle', 'tpope-vim-pathogen')
File.exist? File.join('vim', 'bundle', 'tpope-vim-pathogen')
end