def install_cd
      puts CD_INFO
      print "Continue with installation (yN)? "
      return unless gets.chomp.downcase == "y"
      # get name
      print "Name of pro cd command (default 'pd'): "
      name = gets.strip
      name = 'pd' if name.empty?
      # sub into function
      func = SHELL_FUNCTION.sub("{{name}}",name)
      did_any = false
      ['~/.profile', '~/.bashrc','~/.zshrc','~/.bash_profile'].each do |rel_path|
        # check if file exists
        path = File.expand_path(rel_path)
        next unless File.exists?(path)
        # ask the user if they want to add it
        print "Install #{name} function to #{rel_path} [yN]: "
        next unless gets.chomp.downcase == "y"
        # add it on to the end of the file
        File.open(path,'a') do |file|
          file.puts func
        end
        did_any = true
      end
      if did_any
        puts "Done! #{name} will be available in new shells."
      else
        STDERR.puts "WARNING: Did not install in any shell dotfiles.".red
        STDERR.puts "Maybe you should create the shell config file you want.".red
      end
    end
def install_cd
      puts CD_INFO
      print "Continue with installation (yN)? "
      return unless gets.chomp.downcase == "y"
      # get name
      print "Name of pro cd command (default 'pd'): "
      name = gets.strip
      name = 'pd' if name.empty?
      # sub into function
      func = SHELL_FUNCTION.sub("{{name}}",name)
      did_any = false
      ['~/.profile', '~/.bashrc','~/.zshrc','~/.bash_profile'].each do |rel_path|
        # check if file exists
        path = File.expand_path(rel_path)
        next unless File.exists?(path)
        # ask the user if they want to add it
        print "Install #{name} function to #{rel_path} [yN]: "
        next unless gets.chomp.downcase == "y"
        # add it on to the end of the file
        File.open(path,'a') do |file|
          file.puts func
        end
        did_any = true
      end
      if did_any
        puts "Done! #{name} will be available in new shells."
      else
        STDERR.puts "WARNING: Did not install in any shell dotfiles.".red
        STDERR.puts "Maybe you should create the shell config file you want.".red
      end
    end
Adds a shell function to the shell config files that
 allows easy directory changing.