olds/easy-debian-init.rb
def check_dir_exits(dir)
      if Dir.exists?(dir)
        if Dir.exists?("#{dir}.bkp")
          FileUtils.remove_dir("#{dir}.bkp")
        end
        check_mv = FileUtils.move(dir,"#{dir}.bkp")
        check_status(check_mv,"Creating a backup of directory: #{Tty.white} #{dir} #{Tty.reset}")
      end
    end
# Method to create automatically backup of the files before overwrite them.
Method to create automatically backup of the files before overwrite them.
Method to create automatically backup of the files before overwrite them .
def check_dir_exits(dir)
      if Dir.exists?(dir)
        if Dir.exists?("#{dir}.bkp")
          FileUtils.remove_dir("#{dir}.bkp")
        end
        check_mv = FileUtils.move(dir,"#{dir}.bkp")
        check_status(check_mv,"Creating a backup of directory: #{Tty.white} #{dir} #{Tty.reset}")
      end
    end
def check_dir_exits ( dir ) if Dir . exists? ( dir ) if Dir . exists? ( "#{dir}.bkp" ) FileUtils . remove_dir ( "#{dir}.bkp" ) end check_mv = FileUtils . move ( dir , "#{dir}.bkp" ) check_status ( check_mv , "Creating a backup of directory: #{Tty.white} #{dir} #{Tty.reset}" ) end end
Method to create automatically backup of the files before overwrite them.
Method to create automatically backup of the files before overwrite them .
dir