pod push [REPO_NAME] [SPEC_NAME].podspec pushes into wrong directory #2060

Closed
eliasbagley opened this Issue Apr 16, 2014 · 22 comments

Projects

None yet
@eliasbagley

The private repos have the following structure:

|---Repo name
   ├── Specs
       └── [SPEC_NAME]
           └── [VERSION]
               └── [SPEC_NAME].podspec

When I run the pod push command, It puts the [SPEC_NAME] folder under the RepoName directory, instead of the Specs directory.

@orta
CocoaPods member

This is by design, as that is how the public Specs repo works too, it should look like:

|---Repo name
└── [SPEC_NAME]
  └── [VERSION]
    └── [SPEC_NAME].podspec
@orta orta closed this Apr 16, 2014
@orta
CocoaPods member

Or do you mean in you ~/.cocoapods/ folder?

@orta orta reopened this Apr 16, 2014
@eliasbagley

In the .cocoapods folder. I added a private repo, and want to push a podspec into that private repo, but I have to manually move it into the Specs folder each time I do.

@orta
CocoaPods member

Hrm, yeah, that's what we say it should work in the guides.

Likely a bug with pod push - thanks @eliasbagley

@eliasbagley

Here's the relevant code in pod push:
output_path = File.join(repo_dir, spec.name, spec.version.to_s)

I think it needs to have Specs in there for it to work with this case, but it needs to distinguish somehow between the master repo and the private repos, which seem to have different directory structures.

@tctony

I came across the same problem. Is this bug scheduled to fix in some version in the future?

@fabiopelosin
CocoaPods member

Marked as confirmed.

@fabiopelosin
CocoaPods member

CocoaPods Core uses this logic to distinguish among the two supported styled. That logic could be promoted to a class method and used by the push command directly.

@eliasbagley

Is there a reason why the public and private repos have different directory structures? Why have the Specs sub-directory for private repos?

@fabiopelosin
CocoaPods member

The Specs dir is the new format. When introduced we didn't switch immediately the master repo because we where looking to coalescence all the changes in a single commit and mostly to not break outdated version of CocoaPods. We plan to switch to the new format soon.

@alloy @Keithbsmiley: actually we could add the dir before trunk... no?

@eliasbagley

Cool. I'll take a stab at this fix

@fabiopelosin
CocoaPods member

Ace!

@keith
CocoaPods member

Not sure I understand exactly what all is going on but it should be fine for us!

@alloy
CocoaPods member

@irrationalfab We sure can, but do we really want to bump the min required CP version for the spec repo that many times in a row?

@edwardvalentini

+1 - I came across this issue today.

@edwardvalentini

I submitted a pull request for my solution to this issue

@rhummelmose

Nobody accepted the pull req? I am having the issue here.

@edwardvalentini
@ObjSal

I just started to use CocoaPods for our projects and cam dup with this issue, when will this be released?
Thanks!

@taybenlor

I am still seeing this

@kylef

I can confirm this one has already been fixed:

If you have a Specs directory inside your repo, pod repo push will push into that:

$ mkdir /Users/kylef/.cocoapods/repos/example/Specs
$ pod repo push example QueryKit.podspec
$ tree /Users/kylef/.cocoapods/repos/example
example
└── Specs
    └── QueryKit
        └── 0.8.3
            └── QueryKit.podspec

3 directories, 1 file

If you do not, it will push into the root:

$ pod repo push example QueryKit.podspec
$ tree /Users/kylef/.cocoapods/repos/example
example
└── QueryKit
    └── 0.8.3
        └── QueryKit.podspec

3 directories, 1 file
@kylef kylef closed this Oct 4, 2014
@taybenlor

Thanks! Just updated cocoapods and it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment