Sha256: 73013503bd61f23ad8f9b80b01f1f31b954540bfb20e6745d93069fda1020828

Contents?: true

Size: 993 Bytes

Versions: 2

Compression:

Stored size: 993 Bytes

Contents

module Pod
  class Command
    class RepoTal < Command
      class Remove < RepoTal
        self.summary = 'Remove a spec repo'

        self.description = <<-DESC
          Deletes the remote named `NAME` from the local spec-repos directory at `#{Config.instance.repos_dir}`.
        DESC

        self.arguments = [
          CLAide::Argument.new('NAME', true),
        ]

        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)
          help! "You do not have permission to delete the #{@name} repository." \
                'Perhaps try prefixing this command with sudo.' unless File.writable?(dir)
        end

        def run
          UI.section("Removing spec repo `#{@name}`") do
            FileUtils.rm_rf(dir)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-repo-tal-0.0.2 lib/cocoapods-repo-tal/command/repo/remove.rb
cocoapods-repo-tal-0.0.1 lib/cocoapods-repo-tal/command/repo/remove.rb