Class: Greenhouse::Tasks::RemoveGreenhouseFiles
- Inherits:
-
Object
- Object
- Greenhouse::Tasks::RemoveGreenhouseFiles
- Includes:
- Task
- Defined in:
- lib/greenhouse/tasks/remove_greenhouse_files.rb
Instance Method Summary collapse
-
#perform(force = false) ⇒ Object
TODO maybe DRY this up, and/or break into individual tasks.
Methods included from Task
Instance Method Details
#perform(force = false) ⇒ Object
TODO maybe DRY this up, and/or break into individual tasks
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/greenhouse/tasks/remove_greenhouse_files.rb', line 7 def perform(force=false) if Projects::dotenv.exists? if !force print "Would you like to remove your default configuration file? ([K]eep/[r]emove): " remove = STDIN.gets.chomp.downcase end if ['r','remove'].include?(remove) || force puts "Removing default config file...".yellow Projects::dotenv.unlink end end if Projects::projects_file.exists? if !force print "Would you like to remove your .projects file? ([k]eep/[r]emove): " remove = STDIN.gets.chomp.downcase end if ['r','remove'].include?(remove) || force puts "Removing .projects file...".yellow Projects::projects_file.unlink end end if Projects::ignore_file.exists? if !force print "Would you like to remove your .ignore file? ([k]eep/[r]emove): " remove = STDIN.gets.chomp.downcase end if ['r','remove'].include?(remove) || force puts "Removing .ignore file...".yellow Projects::ignore_file.unlink end end if Projects::procfile.exists? if !force print "Would you like to remove your Procfile? ([k]eep/[r]emove): " remove = STDIN.gets.chomp.downcase end if ['r','remove'].include?(remove) || force puts "Removing Procfile...".yellow Projects::procfile.unlink end end end |