desc "This task will change the emails from backups" $REMOVE_SCRIPT="remove_backup_email.py" $REMOVE_SCRIPT_DIR="utils/#{$REMOVE_SCRIPT}" $BACKUPS_DIR="backups/" task :devbackup do puts "You're NOT in a prod environment" puts "This will alter all the emails." puts "Do you want to alter the backups? [Y/n]" if confirmed sh 'cp' , "#{$REMOVE_SCRIPT_DIR}" , "#{$BACKUPS_DIR}" sh "cd #{$BACKUPS_DIR} && python #{$REMOVE_SCRIPT}" end end def confirmed STDOUT.flush input = STDIN.gets.chomp case input.upcase when "Y", "" puts "Altering emails from backups..." return true when "N" puts "Aborting remove email backups..." puts "Restoring with a normal backups" return false else puts "Please enter Y or N" get_confirmation end end