Class: Golem::Command::DeleteRepository

Inherits:
Base
  • Object
show all
Defined in:
lib/golem/command/delete_repository.rb

Overview

Command for deleting a repository.

Instance Method Summary collapse

Methods inherited from Base

#command, #initialize, #verbose?

Constructor Details

This class inherits a constructor from Golem::Command::Base

Instance Method Details

#run(name) ⇒ Object

Run the command.

Parameters:

  • name (String)

    repository name.



8
9
10
11
12
13
# File 'lib/golem/command/delete_repository.rb', line 8

def run(name)
	repo_path = Golem::Config.repository_path(name)
	abort 'Repository not found!' unless File.directory?(repo_path)
	system("rm -rf #{repo_path}")
	print "Removed repository #{repo_path}\n" if verbose?
end