Class: Gotsha::Actions::Uninstall

Inherits:
Object
  • Object
show all
Defined in:
lib/gotsha/actions/uninstall.rb

Constant Summary collapse

DESCRIPTION =
"removes all Gotsha files and configurations"

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gotsha/actions/uninstall.rb', line 8

def call
  puts "Removing config files..."

  File.exist?(Config::CONFIG_DIR) && FileUtils.rm_rf(Config::CONFIG_DIR)
  File.exist?(Config::GH_CONFIG_FILE) && FileUtils.rm(Config::GH_CONFIG_FILE)
  File.exist?(Config::GL_CONFIG_FILE) && FileUtils.rm(Config::GL_CONFIG_FILE)

  puts "Unsetting Git hooks path..."
  BashCommand.silent_run!("git config --unset core.hooksPath")

  "done"
end