Commit f7766cc3 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge pull request #1493 from Kapin/master

Add pod repo remove [name] command
parents 29697f42 5e5e96ff
...@@ -16,6 +16,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -16,6 +16,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Ulrik Damm](https://github.com/ulrikdamm) [Ulrik Damm](https://github.com/ulrikdamm)
[#1427](https://github.com/CocoaPods/CocoaPods/pull/1427) [#1427](https://github.com/CocoaPods/CocoaPods/pull/1427)
* `pod repo` now support a `remove ['repo_name']` command.
[Joshua Kalpin](https://github.com/Kapin)
[#1493](https://github.com/CocoaPods/CocoaPods/issues/1493)
[#1484](https://github.com/CocoaPods/CocoaPods/issues/1484)
###### Bug Fixes ###### Bug Fixes
* The architecture is now set in the build settings of the user build * The architecture is now set in the build settings of the user build
......
...@@ -133,6 +133,33 @@ module Pod ...@@ -133,6 +133,33 @@ module Pod
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
class Remove < Repo
self.summary = 'Remove a spec repo'
self.description = <<-DESC
Deletes the remote named `NAME` from the local spec-repos directory at `~/.cocoapods/repos/.`
DESC
self.arguments = 'NAME'
def initialize(argv)
@name = argv.shift_argument
super
end
def validate!
super
help! 'Deleting a repo needs a `NAME`.' unless @name
help! "repo #{@name} does not exist" unless File.directory?(dir)
end
def run
UI.section("Removing spec repo `#{@name}`") do
FileUtils.rm_rf(dir)
end
end
end
extend Executable extend Executable
executable :git executable :git
......
...@@ -54,6 +54,13 @@ module Pod ...@@ -54,6 +54,13 @@ module Pod
run_command('repo', 'update', 'repo2') run_command('repo', 'update', 'repo2')
(repo2 + 'README').read.should.include 'Updated' (repo2 + 'README').read.should.include 'Updated'
end end
it "removes a spec-repo" do
upstream = SpecHelper.temporary_directory + 'upstream'
FileUtils.cp_r(test_repo_path, upstream)
lambda { run_command('repo', 'remove', upstream) }.should.not.raise
File.directory?(test_repo_path + upstream).should.be.false?
end
end end
end end
end end
...@@ -12,11 +12,11 @@ module Pod ...@@ -12,11 +12,11 @@ module Pod
Command.parse(%w{ repo add }).should.be.instance_of Command::Repo::Add Command.parse(%w{ repo add }).should.be.instance_of Command::Repo::Add
Command.parse(%w{ repo lint }).should.be.instance_of Command::Repo::Lint Command.parse(%w{ repo lint }).should.be.instance_of Command::Repo::Lint
Command.parse(%w{ repo update }).should.be.instance_of Command::Repo::Update Command.parse(%w{ repo update }).should.be.instance_of Command::Repo::Update
Command.parse(%w{ repo remove }).should.be.instance_of Command::Repo::Remove
Command.parse(%w{ search }).should.be.instance_of Command::Search Command.parse(%w{ search }).should.be.instance_of Command::Search
Command.parse(%w{ setup }).should.be.instance_of Command::Setup Command.parse(%w{ setup }).should.be.instance_of Command::Setup
Command.parse(%w{ spec create }).should.be.instance_of Command::Spec::Create Command.parse(%w{ spec create }).should.be.instance_of Command::Spec::Create
Command.parse(%w{ spec lint }).should.be.instance_of Command::Spec::Lint Command.parse(%w{ spec lint }).should.be.instance_of Command::Spec::Lint
Command.parse(%w{ repo update }).should.be.instance_of Command::Repo::Update
Command.parse(%w{ init }).should.be.instance_of Command::Init Command.parse(%w{ init }).should.be.instance_of Command::Init
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment